> -----Original Message----- > This is true; when the remote port is no longer exists, after timeout > all the sg devices will disappear, but what if I am changing the > configuration in the disk array, and remove only one logical device. > There will not be any event for that. The hotplug > implementation in the > SCSI today creates events of add/remove when adding/removing HBA, or > when the FC link go down and up again, but not for additional and > removal of devices. In the linux documentation in scsi_mid_low_api.txt > it is written that "The hotplug concept may be extended to SCSI > devices". I guess that nobody implemented it because what you said > previously in this thread that someone could hold reference to the > device. > I think that I understand the concept. When the FC port is > going down/up > you get interrupt, so you can remove all devices or initiate scsi scan > and add devices. True - Target-level add or remove usually generates transport events, which allow the transports to detect it. SCSI-Lun-level add/remove doesn't. Well.. it could, as there is a check condition code that can be generated to report configuration change, and in some transports, there's Async Event Notification (AEN) -- BUT -- no one really does AEN, and not all arrays generate the Chk Condition, and even if it did, our midlayer doesn't act on it. And even if the midlayer did act on it, we would have to add device identifier recognition into the equation, which we don't do today, and leave it up to udev. It's not a simple thing to add... > But when device is added you can't get any event, > because this device is not known to the client yet (no body is working > with it), all you can do is to initiate scan every once a while. For > removing a device there is a possibility to do it > automatically. The LLD > can identify that the device is not ready, and then call to the mid > layer to remove this device. It will succeed only if nobody > is holding a > reference to that device. > > Gal. Yep - with the addition of the device identifier part. -- james s -- 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