summaryrefslogtreecommitdiff
path: root/libmultipath/blacklist.c
diff options
context:
space:
mode:
authorChristophe Varoqui <christophe.varoqui@free.fr>2007-11-10 02:22:26 +0100
committerChristophe Varoqui <christophe.varoqui@free.fr>2007-11-10 02:22:26 +0100
commitfa75d374cad8fa966dcf17dc18eee4ef5e70ff33 (patch)
treef69800d8ea310727dc85f04770f4afc64fad8ece /libmultipath/blacklist.c
parentea24bb081efe2564e680d501e4e4dda5daf9b43d (diff)
downloadmultipath-tools-fa75d374cad8fa966dcf17dc18eee4ef5e70ff33.tar.gz
multipath-tools-fa75d374cad8fa966dcf17dc18eee4ef5e70ff33.tar.bz2
multipath-tools-fa75d374cad8fa966dcf17dc18eee4ef5e70ff33.zip
[libmultipath] blacklist exceptions issues
the current situation is fishy. Ben pointed a true braino in the code I introduced when restructuring the blacklist lib : in _filter_path(), I test each _filter_*() for r!=0 , where I intented to check for r>0. r==0 implements : "exit on first blacklist or exception match". r>0 implements : "exit on first blacklist match". With this later behaviour I can set things like that for max safety and efficiency : blacklist { devnode .* device { vendor .* product .* } wwid .* } blacklist_exceptions { devnode sd.* device { vendor IET.* product .* } wwid "1646561646265.*" } or pragmatically : blacklist { devnode .* wwid .* } blacklist_exceptions { devnode sd.* wwid "1646561646265.*" } Working that out, I also realized there may be another small misbehaviour : First, a little background on path discovery operations : 1) /sys/block parsing shows devnode names 2) devnode names examination shows device identification strings 3) these strings help us choose a getuid helper, which finally shows wwids Meaning we want the devnode blacklisting to prevail over device and wwid, in case we know we don't have device strings available (loop, dm-, raw, ...) Similarily, we want the device blacklist to prevail over wwid, in case we know we don't have getuid callout available. I have no example for this case though, so it shouldn't be as important as the previous one. Problem is we challenge _filter_device() after _filter_wwid(). This can be easily shufled around.
Diffstat (limited to 'libmultipath/blacklist.c')
-rw-r--r--libmultipath/blacklist.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/libmultipath/blacklist.c b/libmultipath/blacklist.c
index 9a058f7..6297516 100644
--- a/libmultipath/blacklist.c
+++ b/libmultipath/blacklist.c
@@ -297,16 +297,14 @@ _filter_path (struct config * conf, struct path * pp)
int r;
r = _filter_devnode(conf->blist_devnode, conf->elist_devnode,pp->dev);
- if (r)
- return r;
- r = _filter_wwid(conf->blist_wwid, conf->elist_wwid, pp->wwid);
- if (r)
+ if (r > 0)
return r;
r = _filter_device(conf->blist_device, conf->elist_device,
pp->vendor_id, pp->product_id);
- if (r)
+ if (r > 0)
return r;
- return 0;
+ r = _filter_wwid(conf->blist_wwid, conf->elist_wwid, pp->wwid);
+ return r;
}
int