|
@@ -1095,7 +1095,8 @@ EXPORT_SYMBOL(__starget_for_each_device);
|
|
* Description: Looks up the scsi_device with the specified @lun for a given
|
|
* Description: Looks up the scsi_device with the specified @lun for a given
|
|
* @starget. The returned scsi_device does not have an additional
|
|
* @starget. The returned scsi_device does not have an additional
|
|
* reference. You must hold the host's host_lock over this call and
|
|
* reference. You must hold the host's host_lock over this call and
|
|
- * any access to the returned scsi_device.
|
|
|
|
|
|
+ * any access to the returned scsi_device. A scsi_device in state
|
|
|
|
+ * SDEV_DEL is skipped.
|
|
*
|
|
*
|
|
* Note: The only reason why drivers should use this is because
|
|
* Note: The only reason why drivers should use this is because
|
|
* they need to access the device list in irq context. Otherwise you
|
|
* they need to access the device list in irq context. Otherwise you
|
|
@@ -1107,6 +1108,8 @@ struct scsi_device *__scsi_device_lookup_by_target(struct scsi_target *starget,
|
|
struct scsi_device *sdev;
|
|
struct scsi_device *sdev;
|
|
|
|
|
|
list_for_each_entry(sdev, &starget->devices, same_target_siblings) {
|
|
list_for_each_entry(sdev, &starget->devices, same_target_siblings) {
|
|
|
|
+ if (sdev->sdev_state == SDEV_DEL)
|
|
|
|
+ continue;
|
|
if (sdev->lun ==lun)
|
|
if (sdev->lun ==lun)
|
|
return sdev;
|
|
return sdev;
|
|
}
|
|
}
|