Zhou,

> When a scsi_device is unpluged from scsi controller, if the
> scsi_device is still be used by application layer,it won't be released
> until users release it. In this case, scsi_device_remove just set the
> scsi_device's state to be SDEV_DEL. But if you plug the disk just
> before the old scsi_device is released, then there will be two
> scsi_device structures in scsi_host->__devices. when the next
> unpluging event happens,some low-level drivers will check whether the
> scsi_device has been added to host (for example, the megaraid sas
> series controller) by calling scsi_device_lookup(call
> __scsi_device_lookup) in function
> megasas_aen_polling.__scsi_device_lookup will return the first
> scsi_device.  Because its state is SDEV_DEL, the scsi_device_lookup
> will return NULL finally, making the low-level driver assume that the
> scsi_device has been removed,and won't call scsi_device_remove,which
> will lead the failure of hot swap.

Applied to 4.12/scsi-fixes. Thank you!

-- 
Martin K. Petersen      Oracle Linux Engineering

Reply via email to