diff options
| author | Christoph Hellwig <hch@lst.de> | 2015-08-27 08:17:01 -0400 |
|---|---|---|
| committer | James Bottomley <JBottomley@Odin.com> | 2015-08-28 16:14:58 -0400 |
| commit | d44227749500d8b88a1c079bc04f69187eaf8747 (patch) | |
| tree | 464385f87b69a5536904db5d096362d0d30e5aca /drivers/scsi | |
| parent | e959ed9a44c5239863ca6db42cb37130bee3c7a3 (diff) | |
scsi_dh: don't allow to detach device handlers at runtime
The I/O submission and completion paths call into the device handler
without any synchronization agains detachment. So disallow detaching
device handlers at runtime.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi')
| -rw-r--r-- | drivers/scsi/scsi_dh.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_dh.c b/drivers/scsi/scsi_dh.c index 2e1db5738ae1..9f6511da5023 100644 --- a/drivers/scsi/scsi_dh.c +++ b/drivers/scsi/scsi_dh.c | |||
| @@ -181,8 +181,10 @@ store_dh_state(struct device *dev, struct device_attribute *attr, | |||
| 181 | /* | 181 | /* |
| 182 | * Detach from a device handler | 182 | * Detach from a device handler |
| 183 | */ | 183 | */ |
| 184 | scsi_dh_handler_detach(sdev); | 184 | sdev_printk(KERN_WARNING, sdev, |
| 185 | err = 0; | 185 | "can't detach handler %s.\n", |
| 186 | sdev->handler->name); | ||
| 187 | err = -EINVAL; | ||
| 186 | } else if (!strncmp(buf, "activate", 8)) { | 188 | } else if (!strncmp(buf, "activate", 8)) { |
| 187 | /* | 189 | /* |
| 188 | * Activate a device handler | 190 | * Activate a device handler |
