diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index efc2016..689ae9f 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -639,6 +639,7 @@ get_prio (struct path * pp) } if (!pp->getprio) { pp->priority = 1; + pp->prio_valid = 1; } else if (apply_format(pp->getprio, &buff[0], pp)) { condlog(0, "error formatting prio callout command"); pp->priority = -1; @@ -647,8 +648,10 @@ get_prio (struct path * pp) condlog(0, "error calling out %s", buff); pp->priority = -1; return 1; - } else + } else { pp->priority = atoi(prio); + pp->prio_valid = 1; + } condlog(3, "%s: prio = %u", pp->dev, pp->priority); return 0; @@ -701,7 +704,12 @@ pathinfo (struct path *pp, vector hwtabl if (mask & DI_CHECKER && get_state(pp)) goto blank; - if (mask & DI_PRIO && pp->state != PATH_DOWN) + + /* + * Retrieve path priority for even PATH_DOWN paths if it has never + * been successfully obtained before. + */ + if (mask & DI_PRIO && ((pp->state != PATH_DOWN) || !pp->prio_valid)) get_prio(pp); if (mask & DI_WWID && !strlen(pp->wwid))