reload_and_sync_map() needs to always resync the map after calling
reload_map(), because the mpp state may no longer match the kernel
state if reload_map() fails.

Signed-off-by: Benjamin Marzinski <[email protected]>
---
 multipathd/main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/multipathd/main.c b/multipathd/main.c
index c9cb9ac8..0f763e29 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -2188,13 +2188,15 @@ static int reload_map(struct vectors *vecs, struct 
multipath *mpp,
 
 int reload_and_sync_map(struct multipath *mpp, struct vectors *vecs)
 {
+       int ret = 0;
+
        if (reload_map(vecs, mpp, 1))
-               return 1;
+               ret = 1;
        if (setup_multipath(vecs, mpp) != 0)
                return 2;
        sync_map_state(mpp);
 
-       return 0;
+       return ret;
 }
 
 static int check_path_reinstate_state(struct path * pp) {
-- 
2.45.0


Reply via email to