Blame SOURCES/0034-libmultipath-fix-checker-detection-for-nvme-devices.patch

96a22b
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
96a22b
From: Benjamin Marzinski <bmarzins@redhat.com>
96a22b
Date: Tue, 30 Jun 2020 13:59:13 -0500
96a22b
Subject: [PATCH] libmultipath: fix checker detection for nvme devices
96a22b
96a22b
In order to fix hwhandler autodetection, commit 8794a776 made
96a22b
detect_alua() differentiate between failures to detect whether alua was
96a22b
supported, and successfully detecting that it was not supported.
96a22b
However, this causes nvme devices to get the TUR checker assigned to
96a22b
them. This is because there is nothing in detect_alua() to make it only
96a22b
work on scsi devices, and select_checker wasn't updated to handle
96a22b
detect_alua() failing without setting pp->tpgs to TPGS_NONE.
96a22b
96a22b
detect_alua() should automatically set pp->tpgs to TPGS_NONE and exit on
96a22b
non-scsi devices. Also, select_checker() should not assume that a
96a22b
devices is ALUA, simply because if failed to detect if alua was
96a22b
supported.
96a22b
96a22b
Fixes: 8794a776 "libmultipath: fix ALUA autodetection when paths are
96a22b
                 down"
96a22b
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
96a22b
---
96a22b
 libmultipath/discovery.c | 6 ++++++
96a22b
 libmultipath/propsel.c   | 4 +++-
96a22b
 2 files changed, 9 insertions(+), 1 deletion(-)
96a22b
96a22b
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
96a22b
index 83a41a4a..aa5942c3 100644
96a22b
--- a/libmultipath/discovery.c
96a22b
+++ b/libmultipath/discovery.c
96a22b
@@ -887,6 +887,12 @@ detect_alua(struct path * pp)
96a22b
 	int tpgs;
96a22b
 	unsigned int timeout;
96a22b
 
96a22b
+
96a22b
+	if (pp->bus != SYSFS_BUS_SCSI) {
96a22b
+		pp->tpgs = TPGS_NONE;
96a22b
+		return;
96a22b
+	}
96a22b
+
96a22b
 	if (sysfs_get_timeout(pp, &timeout) <= 0)
96a22b
 		timeout = DEF_TIMEOUT;
96a22b
 
96a22b
diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c
96a22b
index 897e48ca..d362beb4 100644
96a22b
--- a/libmultipath/propsel.c
96a22b
+++ b/libmultipath/propsel.c
96a22b
@@ -521,7 +521,9 @@ int select_checker(struct config *conf, struct path *pp)
96a22b
 		if (check_rdac(pp)) {
96a22b
 			ckr_name = RDAC;
96a22b
 			goto out;
96a22b
-		} else if (path_get_tpgs(pp) != TPGS_NONE) {
96a22b
+		}
96a22b
+		path_get_tpgs(pp);
96a22b
+		if (pp->tpgs != TPGS_NONE && pp->tpgs != TPGS_UNDEF) {
96a22b
 			ckr_name = TUR;
96a22b
 			goto out;
96a22b
 		}
96a22b
-- 
96a22b
2.17.2
96a22b