Blame SOURCES/0113-multipathd-Handle-losing-all-path-in-update_map.patch

108c2a
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
108c2a
From: Benjamin Marzinski <bmarzins@redhat.com>
108c2a
Date: Tue, 9 Aug 2022 16:46:28 -0500
108c2a
Subject: [PATCH] multipathd: Handle losing all path in update_map
108c2a
108c2a
Its possible that when a multipath device is being updated, it will end
108c2a
up that all the paths for it are gone. This can happen if paths are
108c2a
added and then removed again before multipathd processes the uevent for
108c2a
the newly created multipath device. In this case multipathd wasn't
108c2a
taking the proper action for the case where all the paths had been
108c2a
removed. If flush_on_last_del was set, multipathd wasn't disabling
108c2a
flushing and if deferred_remove was set, it wasn't doing a deferred
108c2a
remove. Multipathd should call flush_map_nopaths(), just like
108c2a
ev_remove_path() does when the last path is removed.
108c2a
108c2a
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
108c2a
Reviewed-by: Martin Wilck <mwilck@suse.com>
108c2a
---
108c2a
 multipathd/main.c | 4 ++++
108c2a
 1 file changed, 4 insertions(+)
108c2a
108c2a
diff --git a/multipathd/main.c b/multipathd/main.c
108c2a
index 9eafd5b7..870ae7d8 100644
108c2a
--- a/multipathd/main.c
108c2a
+++ b/multipathd/main.c
108c2a
@@ -526,6 +526,10 @@ retry:
108c2a
 		goto fail;
108c2a
 	}
108c2a
 	verify_paths(mpp, vecs);
108c2a
+	if (VECTOR_SIZE(mpp->paths) == 0 &&
108c2a
+	    flush_map_nopaths(mpp, vecs))
108c2a
+		return 1;
108c2a
+
108c2a
 	mpp->action = ACT_RELOAD;
108c2a
 
108c2a
 	if (setup_map(mpp, params, PARAMS_SIZE, vecs)) {