Skip to contentSkip to conversation

libmultipath: add condition for enqueueing path to io error check

PATCH In review chenrenhui 3 participants 3 messages Jan 10, 2025 – Jan 14, 2025 Device mapper

lore
Share & tools
lore

chenrenhui

author
#0 lore raw

PATCH 1/1 libmultipath: add condition for enqueueing path to io error check

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.

---
 libmultipath/io_err_stat.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
libmultipath/io_err_stat.c +2 -1
index 4996c0b0..879c310a 100644
@@ -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);
Signature · 1 line
2.45.1.windows.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · chenrenhui

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.

Quoted 23 lines
---
 libmultipath/io_err_stat.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
libmultipath/io_err_stat.c +2 -1
index 4996c0b0..879c310a 100644
@@ -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);
Signature · 1 line
2.45.1.windows.1
Reviewed-by on v1 1/1
#2 lore raw
In reply to chenrenhui
Quoted 9 lines · chenrenhui

In function io_err_stat_handle_pathfail(), path-

Quoted 1 line

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.

Quoted 4 lines

To handle the early marginal path, we can enqueue path when io_err_dis_reinstate_time is 0.