summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-02-07 18:31:54 +0100
committerIngo Molnar <mingo@elte.hu>2009-02-07 18:31:54 +0100
commit673f8205914a12e928c65afbcd78ae748f78df53 (patch)
tree38c60215646d079fab3bff812e094e914960c7ec /drivers/scsi/scsi.c
parentcf47b8f3d96b0b8b10b557444a28b3ca4024ff82 (diff)
parentae1a25da8448271a99745da03100d5299575a269 (diff)
downloadop-kernel-dev-673f8205914a12e928c65afbcd78ae748f78df53.zip
op-kernel-dev-673f8205914a12e928c65afbcd78ae748f78df53.tar.gz
Merge branch 'linus' into core/locking
Conflicts: fs/btrfs/locking.c
Diffstat (limited to 'drivers/scsi/scsi.c')
-rw-r--r--drivers/scsi/scsi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 42e72a2..cbcd3f6 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -1095,7 +1095,8 @@ EXPORT_SYMBOL(__starget_for_each_device);
* Description: Looks up the scsi_device with the specified @lun for a given
* @starget. The returned scsi_device does not have an additional
* 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
* 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;
list_for_each_entry(sdev, &starget->devices, same_target_siblings) {
+ if (sdev->sdev_state == SDEV_DEL)
+ continue;
if (sdev->lun ==lun)
return sdev;
}
OpenPOWER on IntegriCloud