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

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