projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
46ccf6b
)
[SCSI] scsi_dh: Check for sdev state in store_dh_state()
author
Hannes Reinecke
<hare@suse.de>
Wed, 24 Aug 2011 08:51:17 +0000
(10:51 +0200)
committer
James Bottomley
<JBottomley@Parallels.com>
Tue, 30 Aug 2011 19:31:24 +0000
(12:31 -0700)
Avoid attaching a hardware handler to a device which is
already scheduled for deletion.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/device_handler/scsi_dh.c
patch
|
blob
|
history
diff --git
a/drivers/scsi/device_handler/scsi_dh.c
b/drivers/scsi/device_handler/scsi_dh.c
index 3ac71cf6b7f0e9427cacbf16a8fec4872fa80016..7c05fd9dccfd1259133adaa1691df648cff56521 100644
(file)
--- a/
drivers/scsi/device_handler/scsi_dh.c
+++ b/
drivers/scsi/device_handler/scsi_dh.c
@@
-190,6
+190,10
@@
store_dh_state(struct device *dev, struct device_attribute *attr,
struct scsi_device_handler *scsi_dh;
int err = -EINVAL;
+ if (sdev->sdev_state == SDEV_CANCEL ||
+ sdev->sdev_state == SDEV_DEL)
+ return -ENODEV;
+
if (!sdev->scsi_dh_data) {
/*
* Attach to a device handler