2b0cd7cceb
Rebased on top of Martin Wilck's queue of ACKed upstream commits * https://github.com/openSUSE/multipath-tools/tree/upstream-queue * All previous patches have been reordered, with the exception of 0011-libdmmp-Add-support-for-upcoming-json-c-0.14.0.patch which has been replaced with 0029-fix-boolean-value-with-json-c-0.14.patch Modify 0054-RH-add-mpathconf.patch * remove default enable_foreign and property blacklist_exceptions settings, and deal with the builtin default change from 0031-libmultipath-set-enable_foreign-to-NONE-by-default.patch. Fixes bz #1853668 Add 0048-Makefile.inc-trim-extra-information-from-systemd-ver.patch Add 0049-kpartx-fix-Wsign-compare-error.patch * The above two patches have been submitted upstream
63 lines
2.0 KiB
Diff
63 lines
2.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Benjamin Marzinski <bmarzins@redhat.com>
|
|
Date: Thu, 2 Jul 2020 19:38:27 -0500
|
|
Subject: [PATCH] libmultipath: fix checker detection for nvme devices
|
|
|
|
In order to fix hwhandler autodetection, commit 8794a776 made
|
|
detect_alua() differentiate between failures to detect whether alua was
|
|
supported, and successfully detecting that it was not supported.
|
|
However, this causes nvme devices to get the TUR checker assigned to
|
|
them. This is because there is nothing in detect_alua() to make it only
|
|
work on scsi devices, and select_checker wasn't updated to handle
|
|
detect_alua() failing without setting pp->tpgs to TPGS_NONE.
|
|
|
|
detect_alua() should automatically set pp->tpgs to TPGS_NONE and exit on
|
|
non-scsi devices. Also, select_checker() should not assume that a
|
|
devices is ALUA, simply because if failed to detect if alua was
|
|
supported.
|
|
|
|
Fixes: 8794a776 "libmultipath: fix ALUA autodetection when paths are
|
|
down"
|
|
Reviewed-by: Martin Wilck <mwilck@suse.com>
|
|
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|
---
|
|
libmultipath/discovery.c | 6 ++++++
|
|
libmultipath/propsel.c | 4 +++-
|
|
2 files changed, 9 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
|
|
index 83a41a4a..aa5942c3 100644
|
|
--- a/libmultipath/discovery.c
|
|
+++ b/libmultipath/discovery.c
|
|
@@ -887,6 +887,12 @@ detect_alua(struct path * pp)
|
|
int tpgs;
|
|
unsigned int timeout;
|
|
|
|
+
|
|
+ if (pp->bus != SYSFS_BUS_SCSI) {
|
|
+ pp->tpgs = TPGS_NONE;
|
|
+ return;
|
|
+ }
|
|
+
|
|
if (sysfs_get_timeout(pp, &timeout) <= 0)
|
|
timeout = DEF_TIMEOUT;
|
|
|
|
diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c
|
|
index 897e48ca..d362beb4 100644
|
|
--- a/libmultipath/propsel.c
|
|
+++ b/libmultipath/propsel.c
|
|
@@ -521,7 +521,9 @@ int select_checker(struct config *conf, struct path *pp)
|
|
if (check_rdac(pp)) {
|
|
ckr_name = RDAC;
|
|
goto out;
|
|
- } else if (path_get_tpgs(pp) != TPGS_NONE) {
|
|
+ }
|
|
+ path_get_tpgs(pp);
|
|
+ if (pp->tpgs != TPGS_NONE && pp->tpgs != TPGS_UNDEF) {
|
|
ckr_name = TUR;
|
|
goto out;
|
|
}
|
|
--
|
|
2.17.2
|
|
|