[libmultipath] coalesce_path() skips 0-sized paths
authorChristophe Varoqui <root@xa-s05.(none)>
Thu, 17 Nov 2005 21:21:04 +0000 (22:21 +0100)
committerChristophe Varoqui <root@xa-s05.(none)>
Thu, 17 Nov 2005 21:21:04 +0000 (22:21 +0100)
These paths can appears in pathvec now that disassemble_map() stores
the paths in pathvec in addition to mpp->pg.

libmultipath/configure.c
libmultipath/structs.c

index 16d6472..56630cc 100644 (file)
@@ -393,6 +393,10 @@ coalesce_paths (vector curmp, vector pathvec)
                if (pp1->mpp)
                        continue;
 
+               /* 3. if path has disappeared */
+               if (!pp1->size)
+                       continue;
+
                /*
                 * at this point, we know we really got a new mp
                 */
@@ -425,14 +429,16 @@ coalesce_paths (vector curmp, vector pathvec)
                        if (strcmp(pp1->wwid, pp2->wwid))
                                continue;
                        
-                       pp2->mpp = mpp;
+                       if (!pp2->size)
+                               continue;
 
                        if (pp2->size != mpp->size) {
                                /*
                                 * ouch, avoid feeding that to the DM
                                 */
-                               condlog(3, "path size mismatch : discard %s",
-                                    mpp->wwid);
+                               condlog(3, "%s: size %llu, expected %llu. "
+                                       "Discard", pp2->dev_t, pp2->size,
+                                       mpp->size);
                                mpp->action = ACT_NOTHING;
                        }
                        if (pp2->priority < 0)
@@ -440,6 +446,8 @@ coalesce_paths (vector curmp, vector pathvec)
 
                        if (store_path(mpp->paths, pp2))
                                return 1;
+
+                       pp2->mpp = mpp;
                }
                if (setup_map(mpp))
                        goto next;
index 627c757..83f9213 100644 (file)
@@ -283,7 +283,7 @@ find_path_by_dev (vector pathvec, char * dev)
                if (!strcmp_chomp(pp->dev, dev))
                        return pp;
 
-       condlog(3, "path %s not found in pathvec\n", dev);
+       condlog(3, "%s: not found in pathvec", dev);
        return NULL;
 }
 
@@ -297,7 +297,7 @@ find_path_by_devt (vector pathvec, char * dev_t)
                if (!strcmp_chomp(pp->dev_t, dev_t))
                        return pp;
 
-       condlog(3, "path %s not found in pathvec\n", dev_t);
+       condlog(3, "%s: not found in pathvec", dev_t);
        return NULL;
 }