[dm-devel] [PATCH 3/3] multipath: fixup check for out-of-scope maps

Hannes Reinecke hare at suse.de
Tue Aug 9 07:31:13 UTC 2016


The 'wwid' in struct multipath is a static array, so a check for
the existence of 'wwid' is pointless. We should rather check if
the argument 'refwwid' is not NULL and has a length larger then '0'.

Signed-off-by: Hannes Reinecke <hare at suse.com>
---
 multipath/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/multipath/main.c b/multipath/main.c
index 93376a9..ee00fdbd 100644
--- a/multipath/main.c
+++ b/multipath/main.c
@@ -212,7 +212,7 @@ get_dm_mpvec (enum mpath_cmds cmd, vector curmp, vector pathvec, char * refwwid)
 		/*
 		 * discard out of scope maps
 		 */
-		if (mpp->wwid && refwwid &&
+		if (refwwid && strlen(refwwid) &&
 		    strncmp(mpp->wwid, refwwid, WWID_SIZE)) {
 			condlog(3, "skip map %s: out of scope", mpp->alias);
 			free_multipath(mpp, KEEP_PATHS);
-- 
2.6.6




More information about the dm-devel mailing list