aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2009-06-22 05:12:11 -0400
committerAlasdair G Kergon <agk@redhat.com>2009-06-22 05:12:11 -0400
commita0cf7ea9549ec60988369f90e5c0f855f08abac9 (patch)
tree9a073e2360afebe6485ac3a78c796627fc9e80b2
parent4d89b7b4e4726893453d0fb4ddbb5b3e16353994 (diff)
dm mpath: change attached scsi_dh
When specifying a different hardware handler via multipath features we should be able to override the built-in defaults. The problem here is the hardware table from scsi_dh is compiled in and cannot be changed from userland. The multipath.conf OTOH is purely user-defined and, what's more, the user might have a valid reason for modifying it. (EG EMC Clariion can well be run in PNR mode even though ALUA is active, or the user might want to try ALUA on any as-of-yet unknown devices) So _not_ allowing multipath to override the device handler setting will just add to the confusion and makes error tracking even more difficult. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
-rw-r--r--drivers/md/dm-mpath.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index f25bdebcb4ab..545abcc25c42 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -597,9 +597,20 @@ static struct pgpath *parse_path(struct arg_set *as, struct path_selector *ps,
597 } 597 }
598 598
599 if (m->hw_handler_name) { 599 if (m->hw_handler_name) {
600 r = scsi_dh_attach(bdev_get_queue(p->path.dev->bdev), 600 struct request_queue *q = bdev_get_queue(p->path.dev->bdev);
601 m->hw_handler_name); 601
602 r = scsi_dh_attach(q, m->hw_handler_name);
603 if (r == -EBUSY) {
604 /*
605 * Already attached to different hw_handler,
606 * try to reattach with correct one.
607 */
608 scsi_dh_detach(q);
609 r = scsi_dh_attach(q, m->hw_handler_name);
610 }
611
602 if (r < 0) { 612 if (r < 0) {
613 ti->error = "error attaching hardware handler";
603 dm_put_device(ti, p->path.dev); 614 dm_put_device(ti, p->path.dev);
604 goto bad; 615 goto bad;
605 } 616 }