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

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