tree e47f7ce03e0a6a3198adfa127a9a7d5d6a60f907
parent 027cf205f2ae2f2abef596e15c6265335b5315be
author Hannes Reinecke <hare@suse.de> 1177054656 +0200
committer Hannes Reinecke <hare@suse.de> 1177054656 +0200

[libmultipath] Fixup priority handling for PATH_GHOST

Now that PATH_GHOST is in common usage, we should handle it
identically to PATH_DOWN when calculating the priority.

References: 256358

Signed-off-by: Hannes Reinecke <hare@suse.de>
86131cf08118632fb632a6d596f384b1a128e673
 libmultipath/discovery.c   |    4 ++--
 libmultipath/switchgroup.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index cf56f9c..8f5aedb 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -112,7 +112,7 @@ out:
  * not multipath(8), ran by udev
  */
 #if DAEMON
-#define WAIT_MAX_SECONDS 5
+#define WAIT_MAX_SECONDS 60
 #define WAIT_LOOP_PER_SECOND 5
 
 static int
@@ -709,7 +709,7 @@ pathinfo (struct path *pp, vector hwtabl
 	  * been successfully obtained before.
 	  */
 	if (mask & DI_PRIO &&
-	    (pp->state != PATH_DOWN || pp->priority == PRIO_UNDEF))
+	    (pp->state == PATH_UP || pp->priority == PRIO_UNDEF))
 		get_prio(pp);
 
 	if (mask & DI_WWID && !strlen(pp->wwid))
diff --git a/libmultipath/switchgroup.c b/libmultipath/switchgroup.c
index 757543f..9b84bc2 100644
--- a/libmultipath/switchgroup.c
+++ b/libmultipath/switchgroup.c
@@ -28,7 +28,7 @@ select_path_group (struct multipath * mp
 		priority = 0;
 
 		vector_foreach_slot (pgp->paths, pp, j) {
-			if (pp->state != PATH_DOWN)
+			if (pp->state == PATH_UP)
 				priority += pp->priority;
 		}
 		pgp->priority = priority;
