Blame SOURCES/0182-multipath-tools-check-for-initialized-checker-before.patch

f20720
From 7592f62383e6143a54d89885e505834c4977c4a6 Mon Sep 17 00:00:00 2001
f20720
From: Mike Christie <mchristi@redhat.com>
f20720
Date: Tue, 16 Aug 2016 11:44:27 -0500
f20720
Subject: [PATCH 06/11] multipath-tools: check for initialized checker before
f20720
f20720
For bz from upstream commit:
f20720
f20720
commit b5773d46a4550c3c222bb415197e0bc5f09c1169
f20720
Author: Mike Christie <mchristi@redhat.com>
f20720
Date:   Mon Aug 15 12:13:45 2016 -0500
f20720
f20720
    multipath-tools: check for initialized checker before
f20720
f20720
    This fixes a regression added with:
f20720
    015f87b16a7797a17afd514aec46e65c2a1a2f73
f20720
f20720
    We can hit a race where when pathinfo is setting up a path, the path
f20720
    could have gone down already. In the DI_CHECKER chunk we then do not
f20720
run
f20720
    get_state and attach a checker. Later when check_path is run
f20720
    path_offline could still return PATH_DOWN or PATH_REMOVED and
f20720
    get_state is again not run so we do not get to attach a checker. I
f20720
    was then running repair_path since the state was PATH_DOWN, and we
f20720
then
f20720
    hit a segfault.
f20720
f20720
    This has us test if a checker is selected before running repair.
f20720
f20720
Signed-off-by: Mike Christie <mchristi@redhat.com>
f20720
---
f20720
 libmultipath/checkers.c | 2 +-
f20720
 1 file changed, 1 insertion(+), 1 deletion(-)
f20720
f20720
diff --git a/libmultipath/checkers.c b/libmultipath/checkers.c
f20720
index fa7d8b7..6cd8d34 100644
f20720
--- a/libmultipath/checkers.c
f20720
+++ b/libmultipath/checkers.c
f20720
@@ -212,7 +212,7 @@ void checker_put (struct checker * dst)
f20720
 
f20720
 void checker_repair (struct checker * c)
f20720
 {
f20720
-	if (!c)
f20720
+	if (!c || !checker_selected(c))
f20720
 		return;
f20720
 
f20720
 	c->message[0] = '\0';
f20720
-- 
f20720
1.8.3.1
f20720