Message ID | 20250110063816.759-1-chenrenhui1@huawei.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | libmultipath: add condition for enqueueing path to io error check | expand |
On Fri, Jan 10, 2025 at 02:38:16PM +0800, chenrenhui wrote: > In function io_err_stat_handle_pathfail(), path->io_err_dis_reinstate_time > is set to 0 to enqueue path to io error check as soon as possible. But > multipathd can not do it within marginal_path_err_recheck_gap_time seconds > after power-on, because curr_time is less than > marginal_path_err_recheck_gap_time. > > To handle the early marginal path, we can enqueue path when > io_err_dis_reinstate_time is 0. Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com> > > Signed-off-by: chenrenhui <chenrenhui1@huawei.com> > --- > libmultipath/io_err_stat.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/libmultipath/io_err_stat.c b/libmultipath/io_err_stat.c > index 4996c0b0..879c310a 100644 > --- a/libmultipath/io_err_stat.c > +++ b/libmultipath/io_err_stat.c > @@ -367,7 +367,8 @@ int need_io_err_check(struct path *pp) > return 1; > get_monotonic_time(&curr_time); > if ((curr_time.tv_sec - pp->io_err_dis_reinstate_time) > > - pp->mpp->marginal_path_err_recheck_gap_time) { > + pp->mpp->marginal_path_err_recheck_gap_time || > + pp->io_err_dis_reinstate_time == 0) { > io_err_stat_log(4, "%s: reschedule checking after %d seconds", > pp->dev, > pp->mpp->marginal_path_err_recheck_gap_time); > -- > 2.45.1.windows.1 >
On Fri, 2025-01-10 at 14:38 +0800, chenrenhui wrote: > In function io_err_stat_handle_pathfail(), path- > >io_err_dis_reinstate_time > is set to 0 to enqueue path to io error check as soon as possible. > But > multipathd can not do it within marginal_path_err_recheck_gap_time > seconds > after power-on, because curr_time is less than > marginal_path_err_recheck_gap_time. > > To handle the early marginal path, we can enqueue path when > io_err_dis_reinstate_time is 0. > > Signed-off-by: chenrenhui <chenrenhui1@huawei.com> Reviewed-by: Martin Wilck <mwilck@suse.com>
diff --git a/libmultipath/io_err_stat.c b/libmultipath/io_err_stat.c index 4996c0b0..879c310a 100644 --- a/libmultipath/io_err_stat.c +++ b/libmultipath/io_err_stat.c @@ -367,7 +367,8 @@ int need_io_err_check(struct path *pp) return 1; get_monotonic_time(&curr_time); if ((curr_time.tv_sec - pp->io_err_dis_reinstate_time) > - pp->mpp->marginal_path_err_recheck_gap_time) { + pp->mpp->marginal_path_err_recheck_gap_time || + pp->io_err_dis_reinstate_time == 0) { io_err_stat_log(4, "%s: reschedule checking after %d seconds", pp->dev, pp->mpp->marginal_path_err_recheck_gap_time);
In function io_err_stat_handle_pathfail(), path->io_err_dis_reinstate_time is set to 0 to enqueue path to io error check as soon as possible. But multipathd can not do it within marginal_path_err_recheck_gap_time seconds after power-on, because curr_time is less than marginal_path_err_recheck_gap_time. To handle the early marginal path, we can enqueue path when io_err_dis_reinstate_time is 0. Signed-off-by: chenrenhui <chenrenhui1@huawei.com> --- libmultipath/io_err_stat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)