[dm-devel] [PATCH v2 64/74] libmultipath: orphan_paths(): avoid BUG message

mwilck at suse.com mwilck at suse.com
Wed Aug 12 11:35:08 UTC 2020


From: Martin Wilck <mwilck at suse.com>

Since c44d769, we print a BUG message when we orphan a path that
holds the mpp->hwe pointer. But if this called via orphan_paths(),
this is expected and we shouldn't warn.

Fixes: c44d769 ("libmultipath: warn if freeing path that holds mpp->hwe")
Signed-off-by: Martin Wilck <mwilck at suse.com>
---
 libmultipath/structs_vec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c
index ba3165a..b644d3f 100644
--- a/libmultipath/structs_vec.c
+++ b/libmultipath/structs_vec.c
@@ -124,6 +124,8 @@ void orphan_paths(vector pathvec, struct multipath *mpp, const char *reason)
 	int i;
 	struct path * pp;
 
+	/* Avoid BUG message from orphan_path() */
+	mpp->hwe = NULL;
 	vector_foreach_slot (pathvec, pp, i) {
 		if (pp->mpp == mpp) {
 			if (pp->initialized == INIT_REMOVED) {
-- 
2.28.0





More information about the dm-devel mailing list