[libmultipath] ghost paths priorities are not set properly
authorChristophe Varoqui <cvaroqui@zezette.localdomain>
Wed, 21 Mar 2007 22:08:43 +0000 (23:08 +0100)
committerChristophe Varoqui <cvaroqui@zezette.localdomain>
Wed, 21 Mar 2007 22:08:43 +0000 (23:08 +0100)
Made some changes to honor the GHOST state while setting priorities.

Chandra Seetharaman, IBM

libmultipath/discovery.c
libmultipath/switchgroup.c

index f270f71..5ca832f 100644 (file)
@@ -706,11 +706,11 @@ pathinfo (struct path *pp, vector hwtable, int mask)
                goto blank;
        
         /*
-         * Retrieve path priority for even PATH_DOWN paths if it has never
+         * Retrieve path priority even for not PATH_UP paths if it has never
          * 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))
index 757543f..9b84bc2 100644 (file)
@@ -28,7 +28,7 @@ select_path_group (struct multipath * mpp)
                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;