libmultipath: Skip paths with empty wwid
authorHannes Reinecke <hare@suse.de>
Fri, 14 Feb 2014 09:14:09 +0000 (10:14 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Sun, 29 Mar 2015 15:41:31 +0000 (17:41 +0200)
If the WWID is empty this is pretty much a terminal error, as
we don't have anything to identify the multipath device.
So skip those devices during discovery.

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath/discovery.c

index 3e0afc4..948fa49 100644 (file)
@@ -1230,7 +1230,8 @@ pathinfo (struct path *pp, vector hwtable, int mask)
        if ((mask & DI_WWID) && !strlen(pp->wwid))
                get_uid(pp);
        if (mask & DI_BLACKLIST && mask & DI_WWID) {
-               if (filter_wwid(conf->blist_wwid, conf->elist_wwid,
+               if (!strlen(pp->wwid) ||
+                   filter_wwid(conf->blist_wwid, conf->elist_wwid,
                                pp->wwid) > 0) {
                        return PATHINFO_SKIPPED;
                }
@@ -1244,6 +1245,8 @@ pathinfo (struct path *pp, vector hwtable, int mask)
                if (pp->state != PATH_DOWN || pp->priority == PRIO_UNDEF) {
                        if (!strlen(pp->wwid))
                                get_uid(pp);
+                       if (!strlen(pp->wwid))
+                               return PATHINFO_SKIPPED;
                        get_prio(pp);
                }
        }