Blame SOURCES/0112-libmultipath-return-success-if-we-raced-to-remove-a-.patch

e88d22
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
e88d22
From: Benjamin Marzinski <bmarzins@redhat.com>
e88d22
Date: Tue, 9 Aug 2022 16:46:27 -0500
e88d22
Subject: [PATCH] libmultipath: return success if we raced to remove a map and
e88d22
 lost
e88d22
e88d22
_dm_flush_map() was returning failure if it failed to remove a map,
e88d22
even if that was because the map had already been removed. Return
e88d22
success in this case.
e88d22
e88d22
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
e88d22
Reviewed-by: Martin Wilck <mwilck@suse.com>
e88d22
---
e88d22
 libmultipath/devmapper.c | 4 ++++
e88d22
 multipathd/main.c        | 4 ----
e88d22
 2 files changed, 4 insertions(+), 4 deletions(-)
e88d22
e88d22
diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c
e88d22
index e3c3c119..ee81acc3 100644
e88d22
--- a/libmultipath/devmapper.c
e88d22
+++ b/libmultipath/devmapper.c
e88d22
@@ -916,6 +916,10 @@ int _dm_flush_map (const char * mapname, int need_sync, int deferred_remove,
e88d22
 			}
e88d22
 			condlog(4, "multipath map %s removed", mapname);
e88d22
 			return 0;
e88d22
+		} else if (dm_is_mpath(mapname) != 1) {
e88d22
+			condlog(4, "multipath map %s removed externally",
e88d22
+				mapname);
e88d22
+			return 0; /*we raced with someone else removing it */
e88d22
 		} else {
e88d22
 			condlog(2, "failed to remove multipath map %s",
e88d22
 				mapname);
e88d22
diff --git a/multipathd/main.c b/multipathd/main.c
e88d22
index 9b1098f6..9eafd5b7 100644
e88d22
--- a/multipathd/main.c
e88d22
+++ b/multipathd/main.c
e88d22
@@ -673,10 +673,6 @@ flush_map(struct multipath * mpp, struct vectors * vecs, int nopaths)
e88d22
 	 * the spurious uevent we may generate with the dm_flush_map call below
e88d22
 	 */
e88d22
 	if (r) {
e88d22
-		/*
e88d22
-		 * May not really be an error -- if the map was already flushed
e88d22
-		 * from the device mapper by dmsetup(8) for instance.
e88d22
-		 */
e88d22
 		if (r == 1)
e88d22
 			condlog(0, "%s: can't flush", mpp->alias);
e88d22
 		else {