|
|
49190a |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
49190a |
From: Benjamin Marzinski <bmarzins@redhat.com>
|
|
|
49190a |
Date: Thu, 19 Mar 2020 22:17:51 -0500
|
|
|
49190a |
Subject: [PATCH] libmultipath: allow force reload with no active paths
|
|
|
49190a |
|
|
|
49190a |
If the partition information has changed on multipath devices (say,
|
|
|
49190a |
because it was updated on another node that has access to the same
|
|
|
49190a |
storage), users expect that running "multipathd reconfigure" will update
|
|
|
49190a |
that. However, if the checkers for the multipath device are pending for
|
|
|
49190a |
too long when the the device is reconfigured, multipathd will give up
|
|
|
49190a |
waiting for them, and refuse to reload the device, since there are no
|
|
|
49190a |
active paths. This means that no kpartx update will be triggered.
|
|
|
49190a |
|
|
|
49190a |
Multipath is fully capable of reloading a multipath device that has no
|
|
|
49190a |
active paths. This has been possible for years. If multipath is supposed
|
|
|
49190a |
to reload the device, it should do so, even if there are no active paths.
|
|
|
49190a |
|
|
|
49190a |
Generally, when multipath is force reloaded, kpartx will be updated.
|
|
|
49190a |
However when a device is reloaded with no paths, the udev rules won't
|
|
|
49190a |
run kpartx. But they also weren't running kpartx when the first valid
|
|
|
49190a |
path appeared, even though the dm activation rules get run in this case.
|
|
|
49190a |
This changes 11-dm-mpath.rules to run kpartx when a device goes from no
|
|
|
49190a |
usable paths to having usable paths.
|
|
|
49190a |
|
|
|
49190a |
Reviewed-by: Martin Wilck <mwilck@suse.com>
|
|
|
49190a |
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|
|
49190a |
---
|
|
|
49190a |
libmultipath/configure.c | 6 ------
|
|
|
49190a |
multipath/11-dm-mpath.rules | 2 +-
|
|
|
49190a |
2 files changed, 1 insertion(+), 7 deletions(-)
|
|
|
49190a |
|
|
|
49190a |
diff --git a/libmultipath/configure.c b/libmultipath/configure.c
|
|
|
49190a |
index c95848a0..96c79610 100644
|
|
|
49190a |
--- a/libmultipath/configure.c
|
|
|
49190a |
+++ b/libmultipath/configure.c
|
|
|
49190a |
@@ -710,12 +710,6 @@ select_action (struct multipath * mpp, vector curmp, int force_reload)
|
|
|
49190a |
return;
|
|
|
49190a |
}
|
|
|
49190a |
|
|
|
49190a |
- if (pathcount(mpp, PATH_UP) == 0) {
|
|
|
49190a |
- mpp->action = ACT_IMPOSSIBLE;
|
|
|
49190a |
- condlog(3, "%s: set ACT_IMPOSSIBLE (no usable path)",
|
|
|
49190a |
- mpp->alias);
|
|
|
49190a |
- return;
|
|
|
49190a |
- }
|
|
|
49190a |
if (force_reload) {
|
|
|
49190a |
mpp->force_udev_reload = 1;
|
|
|
49190a |
mpp->action = ACT_RELOAD;
|
|
|
49190a |
diff --git a/multipath/11-dm-mpath.rules b/multipath/11-dm-mpath.rules
|
|
|
49190a |
index 07320a14..cd522e8c 100644
|
|
|
49190a |
--- a/multipath/11-dm-mpath.rules
|
|
|
49190a |
+++ b/multipath/11-dm-mpath.rules
|
|
|
49190a |
@@ -75,7 +75,7 @@ ENV{MPATH_DEVICE_READY}=="0", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1"
|
|
|
49190a |
ENV{MPATH_DEVICE_READY}!="0", ENV{.MPATH_DEVICE_READY_OLD}=="0",\
|
|
|
49190a |
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="$env{DM_DISABLE_OTHER_RULES_FLAG_OLD}",\
|
|
|
49190a |
ENV{DM_DISABLE_OTHER_RULES_FLAG_OLD}="",\
|
|
|
49190a |
- ENV{DM_ACTIVATION}="1"
|
|
|
49190a |
+ ENV{DM_ACTIVATION}="1", ENV{MPATH_UNCHANGED}="0"
|
|
|
49190a |
|
|
|
49190a |
# The code to check multipath state ends here. We need to set
|
|
|
49190a |
# properties and symlinks regardless whether the map is usable or
|
|
|
49190a |
--
|
|
|
49190a |
2.17.2
|
|
|
49190a |
|