If update_multipath_strings() returns DMP_NOT_FOUND for a map that
we are tracking in the checker, the map must have been removed by
an external entity. Remove it.

Signed-off-by: Martin Wilck <mwi...@suse.com>
---
 multipathd/main.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/multipathd/main.c b/multipathd/main.c
index 8d8b237..138ddd0 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -2411,7 +2411,7 @@ get_new_state(struct path *pp)
        return newstate;
 }
 
-static void
+static int
 do_sync_mpp(struct vectors * vecs, struct multipath *mpp)
 {
        int i, ret;
@@ -2424,21 +2424,22 @@ do_sync_mpp(struct vectors * vecs, struct multipath 
*mpp)
                        "couldn't synchronize with kernel state");
                vector_foreach_slot (mpp->paths, pp, i)
                        pp->dmstate = PSTATE_UNDEF;
-               return;
+               return ret;
        }
        set_no_path_retry(mpp);
+       return ret;
 }
 
-static void
+static int
 sync_mpp(struct vectors * vecs, struct multipath *mpp, unsigned int ticks)
 {
        if (mpp->sync_tick)
                mpp->sync_tick -= (mpp->sync_tick > ticks) ? ticks :
                                  mpp->sync_tick;
        if (mpp->sync_tick && !mpp->checker_count)
-               return;
+               return DMP_OK;
 
-       do_sync_mpp(vecs, mpp);
+       return do_sync_mpp(vecs, mpp);
 }
 
 static int
@@ -2942,7 +2943,11 @@ static void checker_finished(struct vectors *vecs, 
unsigned int ticks)
                bool inconsistent, prio_reload, failback_reload;
                bool uev_wait_reload, ghost_reload;
 
-               sync_mpp(vecs, mpp, ticks);
+               if (sync_mpp(vecs, mpp, ticks) == DMP_NOT_FOUND) {
+                       remove_map_and_stop_waiter(mpp, vecs);
+                       i--;
+                       continue;
+               }
                inconsistent = mpp->need_reload;
                prio_reload = update_mpp_prio(mpp);
                failback_reload = deferred_failback_tick(mpp);
-- 
2.47.0


Reply via email to