[SCSI] Check for deleted device in scsi_device_online()
authorHannes Reinecke <hare@suse.de>
Mon, 12 Jan 2009 08:28:55 +0000 (09:28 +0100)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Thu, 12 Mar 2009 17:57:56 +0000 (12:57 -0500)
scsi_device_online() is not just a negation of SDEV_OFFLINE,
also devices in state SDEV_DEL are actually offline.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
include/scsi/scsi_device.h

index 9576690..15b0926 100644 (file)
@@ -401,7 +401,8 @@ static inline unsigned int sdev_id(struct scsi_device *sdev)
  */
 static inline int scsi_device_online(struct scsi_device *sdev)
 {
-       return sdev->sdev_state != SDEV_OFFLINE;
+       return (sdev->sdev_state != SDEV_OFFLINE &&
+               sdev->sdev_state != SDEV_DEL);
 }
 static inline int scsi_device_blocked(struct scsi_device *sdev)
 {