diff options
-rw-r--r-- | drivers/md/dm-mpath.c | 15 |
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 | } |