diff mbox series

[13/13] libmultipath: be lenient in allowing the alua-based pgpolicies

Message ID 20250123031643.3017891-14-bmarzins@redhat.com (mailing list archive)
State Not Applicable, archived
Delegated to: Benjamin Marzinski
Headers show
Series fix for GitHub issue #108 and misc cleanups | expand

Commit Message

Benjamin Marzinski Jan. 23, 2025, 3:16 a.m. UTC
multipath wouldn't autodetect the GROUP_BY_PRIO path grouping policy or
allow the GROUP_BY_TPG policy if there was a path that didn't have its
prioritizer selected (for instance because multipathd was reconfigured
while it was offline). To avoid this, make verify_alua_prio() assume an
alua multipath device if all the paths with a prioritizer selected
(there must be at least one) use an alua-based prioritizer.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
 libmultipath/propsel.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c
index ad771d35..664e62fc 100644
--- a/libmultipath/propsel.c
+++ b/libmultipath/propsel.c
@@ -255,14 +255,18 @@  verify_alua_prio(struct multipath *mp)
 {
 	int i;
 	struct path *pp;
+	bool assume_alua = false;
 
 	vector_foreach_slot(mp->paths, pp, i) {
 		const char *name = prio_name(&pp->prio);
+		if (!prio_selected(&pp->prio))
+			continue;
 		if (strncmp(name, PRIO_ALUA, PRIO_NAME_LEN) &&
 		    strncmp(name, PRIO_SYSFS, PRIO_NAME_LEN))
 			 return false;
+		assume_alua = true;
 	}
-	return true;
+	return assume_alua;
 }
 
 int select_detect_pgpolicy(struct config *conf, struct multipath *mp)