[RESEND][PATCH] [SCSI] scsi_dh: allow 3rd party multipath drivers touse scsi_dh_detach

From: Mike Snitzer
Date: Fri Apr 20 2012 - 10:46:25 EST

Allow 3rd party multipath drivers to programatically detach a scsi_dh
using the scsi_dh_detach() interface. This is as improvement over
requiring them to write 'detach' to /sys/block/sdX/queue/dh_state

End result is both Linux and 3rd party multipath drivers can coexist
without compromising Linux's default handling of multipath LUNs.

Linux has suffered from races associated with attaching a scsi_dh to a
device too late (after an HBA driver has started the SCSI device scan).
Attaching a scsi_dh too late results in default sense handling that does
not silently fail IO to passive paths, which creates excessive delays
and IO errors during normal boot on a system with hundreds of LUNs.

To fix this the appropriate scsi_dh must be attached before the HBA
driver(s) are even loaded. But some scsi_dh are known to conflict with
3rd party multipath drivers (e.g. both scsi_dh_alua and scsi_dh_emc
conflict with EMC PowerPath). This patch allows 3rd party drivers to
resolve the conflict by detaching an attached scsi_dh.

Signed-off-by: Mike Snitzer <snitzer@xxxxxxxxxx>
Acked-by: Hannes Reinecke <hare@xxxxxxx>
Cc: Chandra Seetharaman <sekharan@xxxxxxxxxx>
drivers/scsi/device_handler/scsi_dh.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/device_handler/scsi_dh.c b/drivers/scsi/device_handler/scsi_dh.c
index 23149b9..a550de1 100644
--- a/drivers/scsi/device_handler/scsi_dh.c
+++ b/drivers/scsi/device_handler/scsi_dh.c
@@ -578,7 +578,7 @@ void scsi_dh_detach(struct request_queue *q)

static struct notifier_block scsi_dh_nb = {
.notifier_call = scsi_dh_notifier
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/