libmultipath: adopt_paths: check for size match
authorMartin Wilck <mwilck@suse.com>
Mon, 10 Dec 2018 09:49:50 +0000 (10:49 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Mon, 10 Dec 2018 23:40:57 +0000 (00:40 +0100)
In coalesce_paths() and ev_add_path(), we check for size mismatch.
We should do it here, too.

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
libmultipath/structs_vec.c

index 01391d7..5305bd3 100644 (file)
@@ -60,6 +60,12 @@ int adopt_paths(vector pathvec, struct multipath *mpp)
 
        vector_foreach_slot (pathvec, pp, i) {
                if (!strncmp(mpp->wwid, pp->wwid, WWID_SIZE)) {
+                       if (pp->size != 0 && mpp->size != 0 &&
+                           pp->size != mpp->size) {
+                               condlog(3, "%s: size mismatch for %s, not adding path",
+                                       pp->dev, mpp->alias);
+                               continue;
+                       }
                        condlog(3, "%s: ownership set to %s",
                                pp->dev, mpp->alias);
                        pp->mpp = mpp;