Blame SOURCES/0089-multipathd-trigger-udev-change-on-path-addition.patch

4745a0
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
4745a0
From: Benjamin Marzinski <bmarzins@redhat.com>
4745a0
Date: Mon, 17 Jan 2022 16:46:18 -0600
4745a0
Subject: [PATCH] multipathd: trigger udev change on path addition
4745a0
4745a0
When a multipath device is created for the first time, there is a window
4745a0
where some path devices way be added to the multipath device, but never
4745a0
claimed in udev. This can allow other device owners, like lvm, to think
4745a0
they can use the device.
4745a0
4745a0
When a multipath device is first created, all the existing paths that
4745a0
are not claimed by multipath have a uevent triggered so that they can
4745a0
get claimed. After that, multipath assumes all future paths added to the
4745a0
multipath device will have been claimed by multipath, since the device's
4745a0
WWID is now in the wwids file.  This doesn't work for any paths that
4745a0
have already been processed by the multipath.rules udev rules before
4745a0
the multipath device was created.
4745a0
4745a0
To close this window, when path device is added, and a matching
4745a0
multipath device already exists, multipathd now checks if the device is
4745a0
claimed by multipath, and if not, triggers a uevent to claim it.
4745a0
4745a0
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
4745a0
---
4745a0
 multipathd/main.c | 2 ++
4745a0
 1 file changed, 2 insertions(+)
4745a0
4745a0
diff --git a/multipathd/main.c b/multipathd/main.c
4745a0
index e2b9d546..f4b79882 100644
4745a0
--- a/multipathd/main.c
4745a0
+++ b/multipathd/main.c
4745a0
@@ -1005,6 +1005,8 @@ ev_add_path (struct path * pp, struct vectors * vecs, int need_do_map)
4745a0
 		free_path(pp);
4745a0
 		return 1;
4745a0
 	}
4745a0
+	if (mpp)
4745a0
+		trigger_path_udev_change(pp, true);
4745a0
 	if (mpp && mpp->wait_for_udev &&
4745a0
 	    (pathcount(mpp, PATH_UP) > 0 ||
4745a0
 	     (pathcount(mpp, PATH_GHOST) > 0 &&