diff mbox series

[v2,7/8] multipathd: trigger uevents upon map removal in coalesce_maps()

Message ID 20241127230430.139639-8-mwilck@suse.com (mailing list archive)
State Not Applicable, archived
Delegated to: Benjamin Marzinski
Headers show
Series multipath-tools fixes | expand

Commit Message

Martin Wilck Nov. 27, 2024, 11:04 p.m. UTC
... if a map has been flushed. In this case, we know that the
the paths haven't been multipathed by coalesce_paths() because of the current
configuration (failure to create the map can't be the reason if the map
exists in coalesce_maps()). Make sure udev sees the paths which have
been released from the map as non-multipath.

Note that this is the only case where maps are flushed where it is correct
to trigger paths uevents. In other cases, e.g. after a "remove map" CLI
command, the configuration is unchanged and if we triggered an uevent,
the map would be re-created by multipathd when the uevent arrived.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 multipathd/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/multipathd/main.c b/multipathd/main.c
index fcab1ed..9ed27da 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -794,8 +794,10 @@  coalesce_maps(struct vectors *vecs, vector nmpv)
 				vector_del_slot(ompv, i);
 				i--;
 			}
-			else
+			else {
 				condlog(2, "%s devmap removed", ompp->alias);
+				trigger_paths_udev_change(ompp, false);
+			}
 		} else if (reassign_maps) {
 			condlog(3, "%s: Reassign existing device-mapper"
 				" devices", ompp->alias);