All of lore.kernel.org
 help / color / mirror / Atom feed
* Multipath blacklist exceptions issues
@ 2007-11-09  0:23 Benjamin Marzinski
  2007-11-09 14:20 ` Stefan Bader
  0 siblings, 1 reply; 18+ messages in thread
From: Benjamin Marzinski @ 2007-11-09  0:23 UTC (permalink / raw)
  To: dm-devel; +Cc: Christophe Varoqui

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

I've noticed some issues with how the blacklist exceptions are currently
working.  One is an obvious bug. Multipathd is treating paths that have
blacklist exceptions the same as paths that are blacklisted. The other
is also incorrect, but I'm not exactly sure what was intended.

If I recall correctly, blacklist exceptions were originally proposed as
a solution to the problem of not being able to remove the bl_product
lines from the default device configuration, without reentering the
whole configuration for that device.  They were specifically designed so
that you could still blacklist the device by wwid and devnode rules.

That is not currently the case.

Right now if you have in your multipath.conf file

blacklist {
	wwid "*"
}

blacklist_exceptions {
	devnode "sda"
}

You will create a multipath device on top of /dev/sda. This makes it
look like exceptions are now being used as a whitelist. However, if you
have

blacklist {
        devnode "*"
}

blacklist_exceptions {
        wwid "3600d0230000000000e13955cc3757800"
}

You will not create any multipath devices.  This doesn't make any sense,
if the earlier example was supposed to create a device. The attached
patch fixes the multipathd issue, and makes blacklist exceptions work
like they originally did, which I assume is what was intended.

-Ben

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

diff -urpN a/libmultipath/blacklist.c b/libmultipath/blacklist.c
--- a/libmultipath/blacklist.c	2007-10-01 13:23:59.000000000 -0500
+++ b/libmultipath/blacklist.c	2007-11-08 17:57:05.000000000 -0600
@@ -297,14 +297,14 @@ _filter_path (struct config * conf, stru
 	int r;
 
 	r = _filter_devnode(conf->blist_devnode, conf->elist_devnode,pp->dev);
-	if (r)
+	if (r == MATCH_WWID_BLIST)
 		return r;
 	r = _filter_wwid(conf->blist_wwid, conf->elist_wwid, pp->wwid);
-	if (r)
+	if (r == MATCH_WWID_BLIST)
 		return r;
 	r = _filter_device(conf->blist_device, conf->elist_device,
 		 	   pp->vendor_id, pp->product_id);
-	if (r)
+	if (r == MATCH_WWID_BLIST)
 		return r;
 	return 0;
 }
diff -urpN a/multipathd/main.c b/multipathd/main.c
--- a/multipathd/main.c	2007-08-15 17:18:27.000000000 -0500
+++ b/multipathd/main.c	2007-11-08 17:57:05.000000000 -0600
@@ -368,7 +368,7 @@ ev_add_path (char * devname, struct vect
 		condlog(0, "%s: failed to get path uid", devname);
 		return 1; /* leave path added to pathvec */
 	}
-	if (filter_path(conf, pp)){
+	if (filter_path(conf, pp) > 0){
 		int i = find_slot(vecs->pathvec, (void *)pp);
 		if (i != -1)
 			vector_del_slot(vecs->pathvec, i);
@@ -1062,7 +1062,7 @@ configure (struct vectors * vecs, int st
 	path_discovery(vecs->pathvec, conf, DI_ALL);
 
 	vector_foreach_slot (vecs->pathvec, pp, i){
-		if (filter_path(conf, pp)){
+		if (filter_path(conf, pp) > 0){
 			vector_del_slot(vecs->pathvec, i);
 			free_path(pp);
 			i--;

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



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

end of thread, other threads:[~2007-11-15 22:03 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-09  0:23 Multipath blacklist exceptions issues Benjamin Marzinski
2007-11-09 14:20 ` Stefan Bader
2007-11-09 20:20   ` Benjamin Marzinski
2007-11-09 23:20     ` Stefan Bader
2007-11-10  1:17       ` Christophe Varoqui
2007-11-13 21:21         ` Benjamin Marzinski
2007-11-10  1:48       ` Benjamin Marzinski
2007-11-11  0:25         ` Stefan Bader
2007-11-13 20:18           ` Benjamin Marzinski
2007-11-13 22:29             ` Kiyoshi Ueda
2007-11-13 23:17             ` Stefan Bader
2007-11-14 20:44               ` Kiyoshi Ueda
     [not found]                 ` <5201e28f0711141411ue475f31qc4db61076479bd7e@mail.gmail.com>
     [not found]                   ` <20071114.182842.97297202.k-ueda@ct.jp.nec.com>
2007-11-15 15:07                     ` Stefan Bader
2007-11-15 15:57                       ` Kiyoshi Ueda
2007-11-15 16:29                       ` Kiyoshi Ueda
2007-11-15 19:24                 ` Benjamin Marzinski
2007-11-15 20:42                   ` Stefan Bader
2007-11-15 22:03                   ` Kiyoshi Ueda

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.