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