Description of problem: Older versions of multipath-tools would always exit with status 0 (success) when flushing multipath device maps (-f/-F). This was never guaranteed but happened because the "r" local in multipath/main.c was used uninitialised in these code paths (by chance, it always lands on a freshly zeroed stack page, so although undefined the behaviour was pretty reliable). This was changed by commit 8497928514aa3df6d46f24d8d9b70b086e9fcfbd: commit 8497928514aa3df6d46f24d8d9b70b086e9fcfbd Author: Christophe Varoqui <root xa-s05 (none)> Date: Mon Mar 13 14:55:16 2006 +0100 [build] minor compilation issues SuSE checker found some minor issues: - refwwid in libmultipath/configure.c:get_refwwid() might be used uninitialized. As dev_type is a simple 'int' there is nothing which prevents the unsuspecting user to call it with an unhandled value. We shoud rather use an enum and set refwwid to NULL to be on the safe side. - attr in libmultipath/discovery.c:devt2devname() might be used uninitialized. Quite unlikely, but might happen in principle. So better have it initialized. - r in multipath/main.c:main() might be used uninitialized. True. So have it initialized. This causes -f/-F in more recent versions of the tools to always exit with status 1 (failure) which does not seem correct. This was discussed on dm-devel and a patch is now in upstream that corrects this behaviour: https://www.redhat.com/archives/dm-devel/2008-December/msg00046.html https://www.redhat.com/archives/dm-devel/2008-December/msg00068.html Version-Release number of selected component (if applicable): device-mapper-multipath-0.4.7-17 How reproducible: 100% Steps to Reproduce: 1. run "multipath -f" with some flushable maps present 2. echo $? 3. Actual results: Always exits with status 1 Expected results: multipath -f <map> ------------------ -f flush a multipath device map specified as parameter, if unused Exit Status 0 The map existed and was successfully flushed 1 The map did not exist or could not be flushed multipath -F ------------ -F flush all unused multipath device maps Exit status 0 At least one unused multipath device map was flushed 1 No unused maps were found or no maps could be flushed Additional info: Two commits needed for this, one to not treat attempts to flush non-mpath maps as an error and the second to or rather than sum the return of dm_flush_map(): commit 80cac070fd5389a17ef82deb66f7c56c8c0b21af Author: Christophe Varoqui <christophe.varoqui> Date: Thu Dec 18 00:13:30 2008 +0100 [lib] dm_flush_map on a non-multipath devmap do nothing and returns 0 So that "multipath -F" can succeed when non-multipath maps are active on the system. commit 3237295a077327188c65456de180ec3027a8f783 Author: Christophe Varoqui <christophe.varoqui> Date: Thu Dec 18 00:01:37 2008 +0100 [lib] don't add up errors in dm_flush_maps() to avoid return code overflow, as pointed by "Bryn M. Reeves", Redhat.
Fix ported from upstream.
~~ Attention - RHEL 5.4 Beta Released! ~~ RHEL 5.4 Beta has been released! There should be a fix present in the Beta release that addresses this particular request. Please test and report back results here, at your earliest convenience. RHEL 5.4 General Availability release is just around the corner! If you encounter any issues while testing Beta, please describe the issues you have encountered and set the bug into NEED_INFO. If you encounter new issues, please clone this bug to open a new issue and request it be reviewed for inclusion in RHEL 5.4 or a later update, if it is not of urgent severity. Please do not flip the bug status to VERIFIED. Only post your verification results, and if available, update Verified field with the appropriate value. Questions can be posted to this bug or your customer or partner representative.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHEA-2009-1377.html