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