Qi, Yanling wrote: > It seems that the reattached SAS devices would take > the same sg slot if the following conditions meet > 1. wait for 2+ minutes for a pending SG-IO write request to come back > before pushing the cable back. The 2+ minutes gives the scsi middle > level to timeout the pending io request and do error-recovery if it is > needed. > 2. close user space fd properly (sg_release will try to do the > sg_dev_arr[k] = NULL. > > Do you see any other conditions? 3. Do not attach other SCSI devices in the meantime. 4. Hope that the kernel re-adds the missing devices in exactly the same order as before. That's why many SCSI transports provide unique persistent identifiers. You can let udev name devices files according to these identifiers or you can query them in your application software. -- Stefan Richter -=====-=-==- =-=- =---= http://arcgraph.de/sr/ - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html