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

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