Blame SOURCES/0026-libmultipath-make-dm_flush_maps-only-return-0-on-suc.patch

96a22b
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
96a22b
From: Benjamin Marzinski <bmarzins@redhat.com>
96a22b
Date: Wed, 17 Jun 2020 13:31:37 -0500
96a22b
Subject: [PATCH] libmultipath: make dm_flush_maps only return 0 on success
96a22b
96a22b
dm_flush_maps() returned both 0 and 1 on error, depending on which part
96a22b
of the function it was in, but the caller was always treating 0 as a
96a22b
success. Make dm_flush_maps() always return 1 on error and 0 on success.
96a22b
96a22b
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
96a22b
---
96a22b
 libmultipath/devmapper.c | 5 +++--
96a22b
 1 file changed, 3 insertions(+), 2 deletions(-)
96a22b
96a22b
diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c
96a22b
index f6204e5f..cda83ce4 100644
96a22b
--- a/libmultipath/devmapper.c
96a22b
+++ b/libmultipath/devmapper.c
96a22b
@@ -953,13 +953,13 @@ dm_flush_map_nopaths(const char * mapname, int deferred_remove)
96a22b
 
96a22b
 int dm_flush_maps (int retries)
96a22b
 {
96a22b
-	int r = 0;
96a22b
+	int r = 1;
96a22b
 	struct dm_task *dmt;
96a22b
 	struct dm_names *names;
96a22b
 	unsigned next = 0;
96a22b
 
96a22b
 	if (!(dmt = libmp_dm_task_create (DM_DEVICE_LIST)))
96a22b
-		return 0;
96a22b
+		return r;
96a22b
 
96a22b
 	dm_task_no_open_count(dmt);
96a22b
 
96a22b
@@ -972,6 +972,7 @@ int dm_flush_maps (int retries)
96a22b
 	if (!names->dev)
96a22b
 		goto out;
96a22b
 
96a22b
+	r = 0;
96a22b
 	do {
96a22b
 		r |= dm_suspend_and_flush_map(names->name, retries);
96a22b
 		next = names->next;
96a22b
-- 
96a22b
2.17.2
96a22b