device-mapper-multipath/0057-libmultipath-deal-with-flushing-no-maps.patch

34 lines
998 B
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Tue, 21 Jul 2020 01:28:22 -0500
Subject: [PATCH] libmultipath: deal with flushing no maps
dm_flush_maps() was failing if there were no device-mapper devices at
all, instead of returning success, since there is nothing to do.
Fixes: "libmultipath: make dm_flush_maps only return 0 on success"
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/devmapper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c
index 126cd728..b8199cb5 100644
--- a/libmultipath/devmapper.c
+++ b/libmultipath/devmapper.c
@@ -1024,10 +1024,10 @@ int dm_flush_maps (int need_suspend, int retries)
if (!(names = dm_task_get_names (dmt)))
goto out;
+ r = 0;
if (!names->dev)
goto out;
- r = 0;
do {
if (need_suspend)
r |= dm_suspend_and_flush_map(names->name, retries);
--
2.17.2