Blame SOURCES/0009-multipathd-use-update_path_groups-instead-of-reload_.patch

a1c519
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
a1c519
From: Benjamin Marzinski <bmarzins@redhat.com>
a1c519
Date: Thu, 21 Feb 2019 17:00:17 -0600
a1c519
Subject: [PATCH] multipathd: use update_path_groups instead of reload_map
a1c519
a1c519
reload_map() doesn't do the work to sync the state after reloading the
a1c519
map.  Instead of calling it directly, cli_reload() and uev_update_path()
a1c519
should call update_path_groups(), which calls reload_map() with all the
a1c519
necessary syncing.
a1c519
a1c519
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
a1c519
---
a1c519
 multipathd/cli_handlers.c |  2 +-
a1c519
 multipathd/main.c         | 13 ++++++++-----
a1c519
 multipathd/main.h         |  2 ++
a1c519
 3 files changed, 11 insertions(+), 6 deletions(-)
a1c519
a1c519
diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c
a1c519
index f95813e..60e17d6 100644
a1c519
--- a/multipathd/cli_handlers.c
a1c519
+++ b/multipathd/cli_handlers.c
a1c519
@@ -877,7 +877,7 @@ cli_reload(void *v, char **reply, int *len, void *data)
a1c519
 		return 1;
a1c519
 	}
a1c519
 
a1c519
-	return reload_map(vecs, mpp, 0, 1);
a1c519
+	return update_path_groups(mpp, vecs, 0);
a1c519
 }
a1c519
 
a1c519
 int resize_map(struct multipath *mpp, unsigned long long size,
a1c519
diff --git a/multipathd/main.c b/multipathd/main.c
a1c519
index fd83a6a..7a317d9 100644
a1c519
--- a/multipathd/main.c
a1c519
+++ b/multipathd/main.c
a1c519
@@ -1273,10 +1273,13 @@ uev_update_path (struct uevent *uev, struct vectors * vecs)
a1c519
 			else {
a1c519
 				if (ro == 1)
a1c519
 					pp->mpp->force_readonly = 1;
a1c519
-				retval = reload_map(vecs, mpp, 0, 1);
a1c519
-				pp->mpp->force_readonly = 0;
a1c519
-				condlog(2, "%s: map %s reloaded (retval %d)",
a1c519
-					uev->kernel, mpp->alias, retval);
a1c519
+				retval = update_path_groups(mpp, vecs, 0);
a1c519
+				if (retval == 2)
a1c519
+					condlog(2, "%s: map removed during reload", pp->dev);
a1c519
+				else {
a1c519
+					pp->mpp->force_readonly = 0;
a1c519
+					condlog(2, "%s: map %s reloaded (retval %d)", uev->kernel, mpp->alias, retval);
a1c519
+				}
a1c519
 			}
a1c519
 		}
a1c519
 	}
a1c519
@@ -1832,7 +1835,7 @@ int update_path_groups(struct multipath *mpp, struct vectors *vecs, int refresh)
a1c519
 
a1c519
 	dm_lib_release();
a1c519
 	if (setup_multipath(vecs, mpp) != 0)
a1c519
-		return 1;
a1c519
+		return 2;
a1c519
 	sync_map_state(mpp);
a1c519
 
a1c519
 	return 0;
a1c519
diff --git a/multipathd/main.h b/multipathd/main.h
a1c519
index 8fd426b..e5c1398 100644
a1c519
--- a/multipathd/main.h
a1c519
+++ b/multipathd/main.h
a1c519
@@ -43,5 +43,7 @@ int __setup_multipath (struct vectors * vecs, struct multipath * mpp,
a1c519
 		       int reset);
a1c519
 #define setup_multipath(vecs, mpp) __setup_multipath(vecs, mpp, 1)
a1c519
 int update_multipath (struct vectors *vecs, char *mapname, int reset);
a1c519
+int update_path_groups(struct multipath *mpp, struct vectors *vecs,
a1c519
+		       int refresh);
a1c519
 
a1c519
 #endif /* MAIN_H */
a1c519
-- 
a1c519
2.17.2
a1c519