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

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