]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.suse/scsi-check-removed-device-for-offline
Fix oinkmaster patch.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.suse / scsi-check-removed-device-for-offline
CommitLineData
2cb7cef9
BS
1From: Hannes Reinecke <hare@suse.de>
2Subject: Check if device is removed in scsi_device_online()
3References: bnc#456747
4
5scsi_device_online() only checks if the device is not offline;
6however, any device in SDEV_DEL or SDEV_CANCEL also should be
7taken into account here.
8
9Signed-off-by: Hannes Reinecke <hare@suse.de>
10
11diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
12index 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 {