Message ID | 20240828221757.4060548-16-bmarzins@redhat.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Delegated to: | Benjamin Marzinski |
Headers | show |
Series | Yet Another path checker refactor | expand |
On Wed, 2024-08-28 at 18:17 -0400, Benjamin Marzinski wrote: > If reload_and_sync_map() removes the multipath device, > deferred_failback_tick() needs to decrement the counter so that it > doesn't skip the following device. > > Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> One day we should add symbolic return values for reload_and_sync_map(). Other than that: Reviewed-by: Martin Wilck <mwilck@suse.com> > --- > multipathd/main.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/multipathd/main.c b/multipathd/main.c > index f9b0ebaf..9e930b53 100644 > --- a/multipathd/main.c > +++ b/multipathd/main.c > @@ -2098,9 +2098,12 @@ deferred_failback_tick (struct vectors *vecs) > > if (!mpp->failback_tick && > need_switch_pathgroup(mpp, > &need_reload)) { > - if (need_reload) > - reload_and_sync_map(mpp, > vecs); > - else > + if (need_reload) { > + if (reload_and_sync_map(mpp, > vecs) == 2) { > + /* multipath device > removed */ > + i--; > + } > + } else > switch_pathgroup(mpp); > } > }
diff --git a/multipathd/main.c b/multipathd/main.c index f9b0ebaf..9e930b53 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -2098,9 +2098,12 @@ deferred_failback_tick (struct vectors *vecs) if (!mpp->failback_tick && need_switch_pathgroup(mpp, &need_reload)) { - if (need_reload) - reload_and_sync_map(mpp, vecs); - else + if (need_reload) { + if (reload_and_sync_map(mpp, vecs) == 2) { + /* multipath device removed */ + i--; + } + } else switch_pathgroup(mpp); } }
If reload_and_sync_map() removes the multipath device, deferred_failback_tick() needs to decrement the counter so that it doesn't skip the following device. Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> --- multipathd/main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)