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