Blame SOURCES/0183-multipathd-Don-t-call-repair-on-blacklisted-path.patch

4ae388
From 2926316c8492a1d18c7bbdac0fac75c38ce16152 Mon Sep 17 00:00:00 2001
4ae388
From: Mike Christie <mchristi@redhat.com>
4ae388
Date: Tue, 16 Aug 2016 11:47:16 -0500
4ae388
Subject: [PATCH 07/11] multipathd: Don't call repair on blacklisted path
4ae388
4ae388
For BZ 1348372 from upstream commit:
4ae388
4ae388
Author: Mike Christie <mchristi@redhat.com>
4ae388
Date:   Mon Aug 15 12:13:46 2016 -0500
4ae388
4ae388
    multipathd: Don't call repair on blacklisted paths
4ae388
4ae388
    This fixes a regression added in
4ae388
    015f87b16a7797a17afd514aec46e65c2a1a2f73
4ae388
4ae388
    If a path is blacklisted the checkerloop will free the path so
4ae388
    don't call repair on it.
4ae388
4ae388
    This moves the repair call down into check_path, because I think
4ae388
    we also do not need to call it for other cases where we cannot get
4ae388
    the uuid info or being orphaned.
4ae388
4ae388
Signed-off-by: Mike Christie <mchristi@redhat.com>
4ae388
---
4ae388
 multipathd/main.c | 22 ++++++++++++----------
4ae388
 1 file changed, 12 insertions(+), 10 deletions(-)
4ae388
4ae388
diff --git a/multipathd/main.c b/multipathd/main.c
4ae388
index d26fd22..4638c8b 100644
4ae388
--- a/multipathd/main.c
4ae388
+++ b/multipathd/main.c
4ae388
@@ -1238,6 +1238,16 @@ int update_path_groups(struct multipath *mpp, struct vectors *vecs, int refresh)
4ae388
 	return 0;
4ae388
 }
4ae388
 
4ae388
+void repair_path(struct path * pp)
4ae388
+{
4ae388
+	if (pp->state != PATH_DOWN)
4ae388
+		return;
4ae388
+
4ae388
+	checker_repair(&pp->checker);
4ae388
+	if (strlen(checker_message(&pp->checker)))
4ae388
+		LOG_MSG(1, checker_message(&pp->checker));
4ae388
+}
4ae388
+
4ae388
 void
4ae388
 check_path (struct vectors * vecs, struct path * pp)
4ae388
 {
4ae388
@@ -1352,6 +1362,7 @@ check_path (struct vectors * vecs, struct path * pp)
4ae388
 			pp->mpp->failback_tick = 0;
4ae388
 
4ae388
 			pp->mpp->stat_path_failures++;
4ae388
+			repair_path(pp);
4ae388
 			return;
4ae388
 		}
4ae388
 
4ae388
@@ -1431,7 +1442,7 @@ check_path (struct vectors * vecs, struct path * pp)
4ae388
 	}
4ae388
 
4ae388
 	pp->state = newstate;
4ae388
-
4ae388
+	repair_path(pp);
4ae388
 
4ae388
 	if (pp->mpp->wait_for_udev)
4ae388
 		return;
4ae388
@@ -1455,14 +1466,6 @@ check_path (struct vectors * vecs, struct path * pp)
4ae388
 	}
4ae388
 }
4ae388
 
4ae388
-void repair_path(struct vectors * vecs, struct path * pp)
4ae388
-{
4ae388
-	if (pp->state != PATH_DOWN)
4ae388
-		return;
4ae388
-
4ae388
-	checker_repair(&pp->checker);
4ae388
-}
4ae388
-
4ae388
 static void *
4ae388
 checkerloop (void *ap)
4ae388
 {
4ae388
@@ -1491,7 +1494,6 @@ checkerloop (void *ap)
4ae388
 		if (vecs->pathvec) {
4ae388
 			vector_foreach_slot (vecs->pathvec, pp, i) {
4ae388
 				check_path(vecs, pp);
4ae388
-				repair_path(vecs, pp);
4ae388
 			}
4ae388
 		}
4ae388
 		if (vecs->mpvec) {
4ae388
-- 
4ae388
1.8.3.1
4ae388