All of lore.kernel.org
 help / color / mirror / Atom feed
* dm-multipath: multipathd blacklisting
@ 2006-02-14 23:01 Benjamin Marzinski
  2006-02-17 23:56 ` Christophe Varoqui
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Marzinski @ 2006-02-14 23:01 UTC (permalink / raw)
  To: dm-devel

[-- Attachment #1: Type: text/plain, Size: 161 bytes --]

multipathd doesn't correctly blacklist devices by wwid, because the blacklist
check happens before the device information is known. This patch fixes that.

-Ben

[-- Attachment #2: blacklist.patch --]
[-- Type: text/plain, Size: 2251 bytes --]

diff -urpN mp-devel-clean/multipathd/cli_handlers.c mp-devel-patched/multipathd/cli_handlers.c
--- mp-devel-clean/multipathd/cli_handlers.c	2006-02-13 11:53:36.000000000 -0600
+++ mp-devel-patched/multipathd/cli_handlers.c	2006-02-14 17:37:05.000000000 -0600
@@ -274,16 +274,18 @@ cli_add_path (void * v, char ** reply, i
 {
 	struct vectors * vecs = (struct vectors *)data;
 	char * param = get_keyparam(v, PATH);
+	int r;
 
 	condlog(2, "%s: add path (operator)", param);
 
-	if (blacklist(conf->blist_devnode, param)) {
+	if (blacklist(conf->blist_devnode, param) ||
+	    (r = ev_add_path(param, vecs)) == 2) {
 		*reply = strdup("blacklisted");
 		*len = strlen(*reply) + 1;
 		condlog(2, "%s: path blacklisted", param);
 		return 0;
 	}
-	return ev_add_path(param, vecs);
+	return r;
 }
 
 int
diff -urpN mp-devel-clean/multipathd/main.c mp-devel-patched/multipathd/main.c
--- mp-devel-clean/multipathd/main.c	2006-02-13 11:53:36.000000000 -0600
+++ mp-devel-patched/multipathd/main.c	2006-02-14 17:37:18.000000000 -0600
@@ -622,9 +622,16 @@ static int
 uev_add_path (char * devname, struct vectors * vecs)
 {
 	condlog(2, "%s: add path (uevent)", devname);
-	return ev_add_path(devname, vecs);
+	return (ev_add_path(devname, vecs) != 1)? 0 : 1;
 }
 
+
+/*
+ * returns:
+ * 0: added
+ * 1: error
+ * 2: blacklisted
+ */
 int
 ev_add_path (char * devname, struct vectors * vecs)
 {
@@ -661,7 +668,13 @@ ev_add_path (char * devname, struct vect
 		condlog(0, "%s: failed to get path uid", devname);
 		return 1; /* leave path added to pathvec */
 	}
-
+	if (blacklist_path(conf, pp)){
+		int i = find_slot(vecs->pathvec, (void *)pp);
+		if (i != -1)
+			vector_del_slot(vecs->pathvec, i);
+		free_path(pp);
+		return 2;
+	}	
 	mpp = pp->mpp = find_mp_by_wwid(vecs->mpvec, pp->wwid);
 rescan:
 	if (mpp) {
@@ -1299,9 +1312,15 @@ configure (struct vectors * vecs, int st
 	 */
 	path_discovery(vecs->pathvec, conf, DI_ALL);
 
-	vector_foreach_slot (vecs->pathvec, pp, i)
-		pp->checkint = conf->checkint;
-
+	vector_foreach_slot (vecs->pathvec, pp, i){
+		if (blacklist_path(conf, pp)){
+			vector_del_slot(vecs->pathvec, i);
+			free_path(pp);
+			i--;
+		}	
+		else
+			pp->checkint = conf->checkint;
+	}
 	if (map_discovery(vecs))
 		return 1;
 

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



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

* Re: dm-multipath: multipathd blacklisting
  2006-02-14 23:01 dm-multipath: multipathd blacklisting Benjamin Marzinski
@ 2006-02-17 23:56 ` Christophe Varoqui
  0 siblings, 0 replies; 2+ messages in thread
From: Christophe Varoqui @ 2006-02-17 23:56 UTC (permalink / raw)
  To: device-mapper development

On mar, 2006-02-14 at 17:01 -0600, Benjamin Marzinski wrote:
> multipathd doesn't correctly blacklist devices by wwid, because the blacklist
> check happens before the device information is known. This patch fixes that.
> 
Applied, thanks.

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

end of thread, other threads:[~2006-02-17 23:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-14 23:01 dm-multipath: multipathd blacklisting Benjamin Marzinski
2006-02-17 23:56 ` Christophe Varoqui

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.