[dm-devel] [PATCH 10/19] libmultipath: restore PG prio in update_multipath_strings
Martin Wilck
mwilck at suse.com
Tue Dec 18 23:19:22 UTC 2018
update_multipath_strings() destroys and recreates the
pathgroup vector. This wipes information previously
stored. Restore the path group priorities.
Fixes: efc7407bed65 "libmultipath: don't update path groups when
printing"
Signed-off-by: Martin Wilck <mwilck at suse.com>
---
libmultipath/structs_vec.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c
index 03e2b978..db5d19da 100644
--- a/libmultipath/structs_vec.c
+++ b/libmultipath/structs_vec.c
@@ -18,6 +18,7 @@
#include "configure.h"
#include "libdevmapper.h"
#include "io_err_stat.h"
+#include "switchgroup.h"
/*
* creates or updates mpp->paths reading mpp->pg
@@ -261,6 +262,9 @@ void sync_paths(struct multipath *mpp, vector pathvec)
int
update_multipath_strings(struct multipath *mpp, vector pathvec, int is_daemon)
{
+ struct pathgroup *pgp;
+ int i;
+
if (!mpp)
return 1;
@@ -278,6 +282,10 @@ update_multipath_strings(struct multipath *mpp, vector pathvec, int is_daemon)
if (update_multipath_status(mpp))
return 1;
+ vector_foreach_slot(mpp->pg, pgp, i)
+ if (pgp->paths)
+ path_group_prio_update(pgp);
+
return 0;
}
--
2.19.2
More information about the dm-devel
mailing list