All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] multipathd: Fixing add map functionality
@ 2015-07-20  9:29 Tejaswini Poluri
  2015-07-20  9:29 ` [PATCH 2/2] multipathd: Disabled code that is not being used Tejaswini Poluri
  0 siblings, 1 reply; 2+ messages in thread
From: Tejaswini Poluri @ 2015-07-20  9:29 UTC (permalink / raw)
  To: dm-devel; +Cc: Tejaswini Poluri

Add map feature of multipathd tools fails as the device
is also been completely removed along with removing the map
in the remove map code.
So when add map is called we are creating the device again
in cli_add_map() using the coloasce_paths code.

Signed-off-by: Tejaswini Poluri <tpoluri@mvista.com>
---
 multipathd/cli_handlers.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c
index dc96c45..032a789 100644
--- a/multipathd/cli_handlers.c
+++ b/multipathd/cli_handlers.c
@@ -535,7 +535,7 @@ cli_add_map (void * v, char ** reply, int * len, void * data)
 	char * param = get_keyparam(v, MAP);
 	int major, minor;
 	char dev_path[PATH_SIZE];
-	char *alias;
+	char *alias, *refwwid;
 	int rc;
 
 	param = convert_dev(param, 0);
@@ -545,27 +545,33 @@ cli_add_map (void * v, char ** reply, int * len, void * data)
 		*reply = strdup("blacklisted\n");
 		*len = strlen(*reply) + 1;
 		condlog(2, "%s: map blacklisted", param);
-		return 0;
+		return 1;
 	}
+mapname:
 	minor = dm_get_minor(param);
 	if (minor < 0) {
 		condlog(2, "%s: not a device mapper table", param);
-		return 0;
 	}
 	major = dm_get_major(param);
 	if (major < 0) {
 		condlog(2, "%s: not a device mapper table", param);
-		return 0;
 	}
 	sprintf(dev_path,"dm-%d", minor);
 	alias = dm_mapname(major, minor);
 	if (!alias) {
 		condlog(2, "%s: mapname not found for %d:%d",
 			param, major, minor);
-		return 0;
+		rc = get_refwwid(param, DEV_DEVMAP, vecs->pathvec, &refwwid);
+		if (refwwid) {
+			if (coalesce_paths(vecs, NULL, refwwid, 0))
+				condlog(2, "%s: coalesce_paths failed", param);
+			dm_lib_release();
+		}
+		goto mapname;
 	}
 	rc = ev_add_map(dev_path, alias, vecs);
 	FREE(alias);
+	FREE(refwwid);
 	return rc;
 }
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] multipathd: Disabled code that is not being used.
  2015-07-20  9:29 [PATCH 1/2] multipathd: Fixing add map functionality Tejaswini Poluri
@ 2015-07-20  9:29 ` Tejaswini Poluri
  0 siblings, 0 replies; 2+ messages in thread
From: Tejaswini Poluri @ 2015-07-20  9:29 UTC (permalink / raw)
  To: dm-devel; +Cc: Tejaswini Poluri

This part of the code is moved to cli_add_map and
disabled here as it is not used by any function call
here.

Signed-off-by: Tejaswini Poluri <tpoluri@mvista.com>
---
 multipathd/main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/multipathd/main.c b/multipathd/main.c
index f876258..e40b968 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -329,6 +329,7 @@ ev_add_map (char * dev, char * alias, struct vectors * vecs)
 			return 1;
 		}
 	}
+#if 0 /*Disabled as the code is not used by any function*/
 	r = get_refwwid(dev, DEV_DEVMAP, vecs->pathvec, &refwwid);
 
 	if (refwwid) {
@@ -344,6 +345,7 @@ ev_add_map (char * dev, char * alias, struct vectors * vecs)
 		condlog(0, "%s: uev_add_map %s failed", alias, dev);
 
 	FREE(refwwid);
+#endif
 	return r;
 }
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-20  9:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-20  9:29 [PATCH 1/2] multipathd: Fixing add map functionality Tejaswini Poluri
2015-07-20  9:29 ` [PATCH 2/2] multipathd: Disabled code that is not being used Tejaswini Poluri

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.