diff -u multipath-tools-0.4.8/debian/changelog multipath-tools-0.4.8/debian/changelog --- multipath-tools-0.4.8/debian/changelog +++ multipath-tools-0.4.8/debian/changelog @@ -1,3 +1,16 @@ +multipath-tools (0.4.8-14ubuntu11) oneiric; urgency=low + + * Fixes some return logic issues in the blacklist.c:_filter_path function + where using blacklist and blacklist_exceptions would cause multipathd to + improperly filter paths. (LP: #789229) + - The patch was created by Christophe Varoqui in 2007. + + http://www.redhat.com/archives/dm-devel/2007-November/msg00054.html + + 0013-libmultipath-filter_path-fix_blacklist_filter_exit.patch + - [serge-hallyn] swap in the whole upstream git commit and call it + 0013-blacklist_exception_issues.patch. + + -- Craig Magina Fri, 27 May 2011 11:47:19 -0400 + multipath-tools (0.4.8-14ubuntu10) natty; urgency=low * pass '-p part' to kpartx in initramfs script, not '-p p', to diff -u multipath-tools-0.4.8/debian/patches/series multipath-tools-0.4.8/debian/patches/series --- multipath-tools-0.4.8/debian/patches/series +++ multipath-tools-0.4.8/debian/patches/series @@ -17,0 +18 @@ +0013-blacklist_exception_issues.patch only in patch2: unchanged: --- multipath-tools-0.4.8.orig/debian/patches/0013-blacklist_exception_issues.patch +++ multipath-tools-0.4.8/debian/patches/0013-blacklist_exception_issues.patch @@ -0,0 +1,114 @@ +commit fa75d374cad8fa966dcf17dc18eee4ef5e70ff33 +Author: Christophe Varoqui +Date: Sat Nov 10 02:22:26 2007 +0100 + + [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. + +Index: multipath-tools-0.4.8/libmultipath/blacklist.c +=================================================================== +--- multipath-tools-0.4.8.orig/libmultipath/blacklist.c 2011-06-03 14:09:00.000000000 -0500 ++++ multipath-tools-0.4.8/libmultipath/blacklist.c 2011-06-03 14:10:32.705437655 -0500 +@@ -303,16 +303,14 @@ + 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 +Index: multipath-tools-0.4.8/multipathd/main.c +=================================================================== +--- multipath-tools-0.4.8.orig/multipathd/main.c 2011-06-03 14:09:00.645437642 -0500 ++++ multipath-tools-0.4.8/multipathd/main.c 2011-06-03 14:10:32.705437655 -0500 +@@ -368,7 +368,7 @@ + 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); +@@ -1060,7 +1060,7 @@ + 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--;