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

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