libmultipath: Only count UP and GHOST paths for prio update
authorHannes Reinecke <hare@suse.de>
Thu, 10 Feb 2011 09:35:28 +0000 (10:35 +0100)
committerHannes Reinecke <hare@suse.de>
Wed, 18 May 2011 08:34:38 +0000 (10:34 +0200)
When calculating the priority of a pathgroup we should be
counting only UP and GHOST paths; all other values might
be stale.

References: bnc#665289

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath/switchgroup.c

index 025a95d..031c3d7 100644 (file)
@@ -20,7 +20,8 @@ path_group_prio_update (struct pathgroup * pgp)
                return;
        }
        vector_foreach_slot (pgp->paths, pp, i) {
-               if (pp->state != PATH_DOWN) {
+               if (pp->state == PATH_UP ||
+                   pp->state == PATH_GHOST) {
                        priority += pp->priority;
                        pgp->enabled_paths++;
                }