On 03/02/2010 02:35 AM, Ulrich Windl wrote:
On 2 Mar 2010 at 1:21, Mike Christie wrote:

Make sure everything is unmounted when you delete/logout, and make sure
something like dm/md raid/multipath is not using the device.


Mike,

would it make any sense to wait until the devices are no longer in use?
It might be preferrable to a kernel error message. You could still add
a "force" option if someone persists on doing a logout on busy devices.



Anyone with root privs can use one of the scsi interfaces (like /sys/block/sdb/device/delete) and remove the device from under other users and cause this problem.

The scsi and iscsi layer also supports hot unplugging of devices, so in many cases you can remove a HBA or a disk and the disk should just get cleaned up (like when you just rip out a usb device) and we have no control over the user doing this, but we are supposed to handle it.

And the FC layer and other drivers like SAS ones (iscsi is supposed to do it too, but I have not got around to changing the code), will begin the removal process if a port has been disconnected long enough (this is why it is common to hit the problem with dm-multipath and FC).

So for the above we do not have any control over it, and the problem is just buggy code which Hannes from SUSE has been working on fixing. If that is fixed then the problem where someone or the iscsi scripts runs iscsiadm ...--logout would also get fixed with it.

If you wanted to check if a device was in use to prevent a user mistake like logging out before they unmounted a FS, then yeah, I think it could be useful. I am just not sure how to do it nicely. I think we would have to add a API to the SCSI layer to peak at the device's refcount to check and see if there are any external users.

--
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-is...@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.

Reply via email to