[dm-devel] [PATCH v3 15/24] libmultipath: adopt_paths: check for size match
Martin Wilck
mwilck at suse.com
Mon Dec 10 09:49:50 UTC 2018
In coalesce_paths() and ev_add_path(), we check for size mismatch.
We should do it here, too.
Reviewed-by: Benjamin Marzinski <bmarzins at redhat.com>
Signed-off-by: Martin Wilck <mwilck at suse.com>
---
libmultipath/structs_vec.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c
index 01391d77..5305bd31 100644
--- a/libmultipath/structs_vec.c
+++ b/libmultipath/structs_vec.c
@@ -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;
--
2.19.2
More information about the dm-devel
mailing list