_dm_flush_map() was returning failure if it failed to remove a map,
even if that was because the map had already been removed. Return
success in this case.

Signed-off-by: Benjamin Marzinski <bmarz...@redhat.com>
---
 libmultipath/devmapper.c | 4 ++++
 multipathd/main.c        | 4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c
index 1748d258..a49db3b0 100644
--- a/libmultipath/devmapper.c
+++ b/libmultipath/devmapper.c
@@ -1111,6 +1111,10 @@ int _dm_flush_map (const char * mapname, int need_sync, 
int deferred_remove,
                        }
                        condlog(4, "multipath map %s removed", mapname);
                        return 0;
+               } else if (dm_is_mpath(mapname) != 1) {
+                       condlog(4, "multipath map %s removed externally",
+                               mapname);
+                       return 0; /*we raced with someone else removing it */
                } else {
                        condlog(2, "failed to remove multipath map %s",
                                mapname);
diff --git a/multipathd/main.c b/multipathd/main.c
index 325f8cd4..1380dd8b 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -758,10 +758,6 @@ flush_map(struct multipath * mpp, struct vectors * vecs, 
int nopaths)
         * the spurious uevent we may generate with the dm_flush_map call below
         */
        if (r) {
-               /*
-                * May not really be an error -- if the map was already flushed
-                * from the device mapper by dmsetup(8) for instance.
-                */
                if (r == 1)
                        condlog(0, "%s: can't flush", mpp->alias);
                else {
-- 
2.17.2

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel

Reply via email to