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

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