Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Device-mapper Development (http://www.linux-archive.org/device-mapper-development/)
-   -   dm-mpath: Allow 'default' hardware handler (http://www.linux-archive.org/device-mapper-development/651838-dm-mpath-allow-default-hardware-handler.html)

Hannes Reinecke 04-02-2012 04:43 PM

dm-mpath: Allow 'default' hardware handler
 
This patch introduces a 'default' hardware handler for dm-mpath.
When specifying '1 default' dm-multipath will be using the currently
attached hardware handler.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/md/dm-mpath.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index 922a338..bbf950f 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -586,15 +586,19 @@ static struct pgpath *parse_path(struct dm_arg_set *as, struct path_selector *ps

if (m->hw_handler_name) {
struct request_queue *q = bdev_get_queue(p->path.dev->bdev);
+ char *hw_handler = NULL;

- r = scsi_dh_attach(q, m->hw_handler_name);
+ if (strncmp(m->hw_handler_name, "default", 6))
+ hw_handler = m->hw_handler_name;
+
+ r = scsi_dh_attach(q, hw_handler);
if (r == -EBUSY) {
/*
* Already attached to different hw_handler,
* try to reattach with correct one.
*/
scsi_dh_detach(q);
- r = scsi_dh_attach(q, m->hw_handler_name);
+ r = scsi_dh_attach(q, hw_handler);
}

if (r < 0) {
--
1.7.7

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


All times are GMT. The time now is 07:09 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.