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 <bmarz...@redhat.com>
---
 libmultipath/propsel.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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)
-- 
2.46.2


Reply via email to