Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d4422774 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by James Bottomley
Browse files

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarJames Bottomley <JBottomley@Odin.com>
parent e959ed9a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -181,8 +181,10 @@ store_dh_state(struct device *dev, struct device_attribute *attr,
			/*
			 * Detach from a device handler
			 */
			scsi_dh_handler_detach(sdev);
			err = 0;
			sdev_printk(KERN_WARNING, sdev,
				    "can't detach handler %s.\n",
				    sdev->handler->name);
			err = -EINVAL;
		} else if (!strncmp(buf, "activate", 8)) {
			/*
			 * Activate a device handler