]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | From: Hannes Reinecke <hare@suse.de> |
2 | Subject: Check if device is removed in scsi_device_online() | |
3 | References: bnc#456747 | |
4 | ||
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. | |
8 | ||
9 | Signed-off-by: Hannes Reinecke <hare@suse.de> | |
10 | ||
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) | |
16 | */ | |
17 | static inline int scsi_device_online(struct scsi_device *sdev) | |
18 | { | |
19 | - return sdev->sdev_state != SDEV_OFFLINE; | |
20 | + return (sdev->sdev_state != SDEV_OFFLINE && | |
21 | + sdev->sdev_state != SDEV_DEL); | |
22 | } | |
23 | static inline int scsi_device_blocked(struct scsi_device *sdev) | |
24 | { |