Blame SOURCES/0003-multipathd-cleanup-marginal-paths-checking-timers.patch

a1c519
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
a1c519
From: Benjamin Marzinski <bmarzins@redhat.com>
a1c519
Date: Fri, 25 Jan 2019 17:09:42 -0600
a1c519
Subject: [PATCH] multipathd: cleanup marginal paths checking timers
a1c519
a1c519
When a path gets recovered in hit_io_err_recheck_time(), it will
a1c519
continue running in check_path(), so there is no reason to schedule
a1c519
another path check as soon as possible (since one is currently
a1c519
happening).
a1c519
a1c519
Also, there isn't much point in restarting the io err stat checking when
a1c519
the path is down, so hit_io_err_recheck_time() should only be run when
a1c519
the path is up. Downed marginal paths can be treated just like any other
a1c519
downed path.
a1c519
a1c519
Finally, there is no reason to set reset pp->io_err_dis_reinstate_time
a1c519
when we decide to enqueue a path. Either th enqueue will fail and the
a1c519
path will get recovered, or it will succeed, and we won't check the
a1c519
reinstate time again until poll_io_err_stat() marks the path as needing
a1c519
a requeue.
a1c519
a1c519
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
a1c519
---
a1c519
 libmultipath/io_err_stat.c | 8 --------
a1c519
 multipathd/main.c          | 3 ++-
a1c519
 2 files changed, 2 insertions(+), 9 deletions(-)
a1c519
a1c519
diff --git a/libmultipath/io_err_stat.c b/libmultipath/io_err_stat.c
a1c519
index 1cb3ffe..416e13a 100644
a1c519
--- a/libmultipath/io_err_stat.c
a1c519
+++ b/libmultipath/io_err_stat.c
a1c519
@@ -400,13 +400,6 @@ int hit_io_err_recheck_time(struct path *pp)
a1c519
 		io_err_stat_log(4, "%s: reschedule checking after %d seconds",
a1c519
 				pp->dev,
a1c519
 				pp->mpp->marginal_path_err_recheck_gap_time);
a1c519
-		/*
a1c519
-		 * to reschedule io error checking again
a1c519
-		 * if the path is good enough, we claim it is good
a1c519
-		 * and can be reinsated as soon as possible in the
a1c519
-		 * check_path routine.
a1c519
-		 */
a1c519
-		pp->io_err_dis_reinstate_time = curr_time.tv_sec;
a1c519
 		r = enqueue_io_err_stat_by_path(pp);
a1c519
 		/*
a1c519
 		 * Enqueue fails because of internal error.
a1c519
@@ -426,7 +419,6 @@ int hit_io_err_recheck_time(struct path *pp)
a1c519
 recover:
a1c519
 	pp->io_err_pathfail_cnt = 0;
a1c519
 	pp->io_err_disable_reinstate = 0;
a1c519
-	pp->tick = 1;
a1c519
 	return 0;
a1c519
 }
a1c519
 
a1c519
diff --git a/multipathd/main.c b/multipathd/main.c
a1c519
index fb520b6..fe6d8ef 100644
a1c519
--- a/multipathd/main.c
a1c519
+++ b/multipathd/main.c
a1c519
@@ -2079,7 +2079,8 @@ check_path (struct vectors * vecs, struct path * pp, int ticks)
a1c519
 		return 1;
a1c519
 	}
a1c519
 
a1c519
-	if (pp->io_err_disable_reinstate && hit_io_err_recheck_time(pp)) {
a1c519
+	if ((newstate == PATH_UP || newstate == PATH_GHOST) &&
a1c519
+	    pp->io_err_disable_reinstate && hit_io_err_recheck_time(pp)) {
a1c519
 		pp->state = PATH_SHAKY;
a1c519
 		/*
a1c519
 		 * to reschedule as soon as possible,so that this path can
a1c519
-- 
a1c519
2.17.2
a1c519