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