Skip to content

Commit

Permalink
multipathd: reload maps in do_sync_mpp() if necessary
Browse files Browse the repository at this point in the history
update_pathvec_from_dm() may set mpp->need_reload if it finds inconsistent
settings. In this case, the map should be reloaded, but so far we don't
do this reliably. Add a call to reload_map() to do_sync_mpp() to
clear this kind of inconsistency. In order to avoid endless reload loops,
limit the number of retries to 1.

Fixes: opensvc#105
Signed-off-by: Martin Wilck <[email protected]>
  • Loading branch information
mwilck committed Dec 4, 2024
1 parent 6118ee7 commit 01ec4fa
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions multipathd/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2459,7 +2459,10 @@ do_sync_mpp(struct vectors * vecs, struct multipath *mpp)
{
int i, ret;
struct path *pp;
const int MAX_RETRIES = 1;
int retry = 0;

try_again:
ret = update_multipath_strings(mpp, vecs->pathvec);
if (ret != DMP_OK) {
condlog(1, "%s: %s", mpp->alias, ret == DMP_NOT_FOUND ?
Expand All @@ -2468,6 +2471,14 @@ do_sync_mpp(struct vectors * vecs, struct multipath *mpp)
vector_foreach_slot (mpp->paths, pp, i)
pp->dmstate = PSTATE_UNDEF;
return;
} else if (mpp->need_reload) {
if (retry++ < MAX_RETRIES) {
condlog(2, "%s: %s needs reload", __func__, mpp->alias);
reload_map(vecs, mpp, 1);
goto try_again;
} else
condlog(1, "%s: %s still needs reload after %d retries, giving up",
__func__, mpp->alias, retry);
}
set_no_path_retry(mpp);
}
Expand Down

0 comments on commit 01ec4fa

Please sign in to comment.