Skip to contentSkip to conversation

multipath: check setup_multipath return value.

PATCH In review Benjamin Marzinski 1 participant 2 messages Jul 13, 2011 – Sep 1, 2011 Device mapper

lore
Share & tools
lore

Benjamin Marzinski

author maintainer
#0 lore raw

PATCH 1/1 multipath: check setup_multipath return value.

When setup_multipath() fails, it removes the map. So update_path_groups() needs check the return value, and fail without touching the map anymore if setup_multipath() fails.

---
 multipathd/main.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
multipathd/main.c +2 -1
Index: multipath-tools-110713/multipathd/main.c
===================================================================
@@ -1060,7 +1060,8 @@ int update_path_groups(struct multipath 
 		return 1;
 	}
 	dm_lib_release();
-	setup_multipath(vecs, mpp);
+	if (setup_multipath(vecs, mpp) != 0)
+		return 1;
 	sync_map_state(mpp);
 
 	return 0;
author maintainer
#1 lore raw

Christophe, would it be possible to get this merged?

Thanks,
-Ben

Quoted 28 lines · Benjamin Marzinski

When setup_multipath() fails, it removes the map. So update_path_groups() needs check the return value, and fail without touching the map anymore if setup_multipath() fails.

---
 multipathd/main.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: multipath-tools-110713/multipathd/main.c
===================================================================

multipathd/main.c +2 -2
@@ -1060,7 +1060,8 @@ int update_path_groups(struct multipath 
 		return 1;
 	}
 	dm_lib_release();
-	setup_multipath(vecs, mpp);
+	if (setup_multipath(vecs, mpp) != 0)
+		return 1;
 	sync_map_state(mpp);
 
 	return 0;
 
--

dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel