Blame SOURCES/0003-libmultipath-allow-force-reload-with-no-active-paths.patch

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