Allow zero-sized devices during configuration
authorHannes Reinecke <hare@suse.de>
Mon, 18 Aug 2014 11:22:47 +0000 (13:22 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Sun, 29 Mar 2015 16:09:51 +0000 (18:09 +0200)
A size of '0' doesn't indicate an invalid device; other paths might
end up with a correct size.

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

index 2c10c22..ddbd3ed 100644 (file)
@@ -768,8 +768,8 @@ coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid, int force_r
                        continue;
 
                /* 3. if path has disappeared */
-               if (!pp1->size) {
-                       orphan_path(pp1, "invalid size");
+               if (pp1->state == PATH_REMOVED) {
+                       orphan_path(pp1, "path removed");
                        continue;
                }
 
@@ -806,10 +806,11 @@ coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid, int force_r
                        if (strcmp(pp1->wwid, pp2->wwid))
                                continue;
 
-                       if (!pp2->size)
-                               continue;
+                       if (!mpp->size && pp2->size)
+                               mpp->size = pp2->size;
 
-                       if (pp2->size != mpp->size) {
+                       if (mpp->size && pp2->size &&
+                           pp2->size != mpp->size) {
                                /*
                                 * ouch, avoid feeding that to the DM
                                 */