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