1 From: Hannes Reinecke <hare@suse.de>
2 Subject: Check if device is removed in scsi_device_online()
5 scsi_device_online() only checks if the device is not offline;
6 however, any device in SDEV_DEL or SDEV_CANCEL also should be
7 taken into account here.
9 Signed-off-by: Hannes Reinecke <hare@suse.de>
11 diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
12 index e96daf6..63b58d2 100644
13 --- a/include/scsi/scsi_device.h
14 +++ b/include/scsi/scsi_device.h
15 @@ -401,7 +401,8 @@ static inline unsigned int sdev_id(struct scsi_device *sdev)
17 static inline int scsi_device_online(struct scsi_device *sdev)
19 - return sdev->sdev_state != SDEV_OFFLINE;
20 + return (sdev->sdev_state != SDEV_OFFLINE &&
21 + sdev->sdev_state != SDEV_DEL);
23 static inline int scsi_device_blocked(struct scsi_device *sdev)