]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
libafs: Correct afs_LoopServers flags
authorAndrew Deason <adeason@sinenomine.net>
Thu, 5 May 2011 16:37:12 +0000 (11:37 -0500)
committerAndrew Deason <adeason@sinenomine.net>
Mon, 29 Oct 2012 15:18:56 +0000 (08:18 -0700)
AFS_LS_DOWN was actually checking up servers, and AFS_LS_UP was
checking down servers. Fix the handling of the 'adown' flag so we do
the right thing.

1.6-only: Note that this does not contain the change to afs_FlushVCBs,
since 1.6 does not contain change cee2c677, which introduced the
relevant afs_FlushVCBs afs_LoopServers call.

Reviewed-on: http://gerrit.openafs.org/4624
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 1f48bc7a30d5df88a1e5f539ee22df3952533a88)

Change-Id: Ibf56812134800a047642455a528dae488c52bcf9
Reviewed-on: http://gerrit.openafs.org/8309
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
src/afs/afs_call.c
src/afs/afs_server.c

index c46d203f6e3fc6979d871f2f8af05b23be6f909a..3d184b5d6525df2eacb17cfebe5de6ee3d9faffa 100644 (file)
@@ -1169,7 +1169,7 @@ afs_syscall_call(long parm, long parm2, long parm3,
 
        if (refresh) {
            afs_CheckServers(1, NULL);     /* check down servers */
-           afs_CheckServers(0, NULL);     /* check down servers */
+           afs_CheckServers(0, NULL);     /* check up servers */
        }
     }
 #ifdef AFS_SGI53_ENV
index 178169f45dc64137e32caada01e1946ff5d1e66d..8470ca6a2386febaa8defab69e13c901656dcfee 100644 (file)
@@ -751,7 +751,9 @@ afs_CheckServers(int adown, struct cell *acellp)
                    afs_setTime?CkSrv_SetTime:NULL);
 }
 
-/* adown: 0 - check only down. 1 - check only up. 2 - check all */
+/* adown: AFS_LS_UP   - check only up
+ *        AFS_LS_DOWN - check only down.
+ *        AFS_LS_ALL  - check all */
 void
 afs_LoopServers(int adown, struct cell *acellp, int vlalso,
                void (*func1) (struct rx_connection **rxconns, int nconns,
@@ -838,8 +840,8 @@ afs_LoopServers(int adown, struct cell *acellp, int vlalso,
        if (acellp && acellp != ts->cell)
            continue;
 
-       if (((adown==AFS_LS_DOWN) && (sa->sa_flags & SRVADDR_ISDOWN))
-           || ((adown==AFS_LS_UP) && !(sa->sa_flags & SRVADDR_ISDOWN)))
+       if (((adown==AFS_LS_DOWN) && !(sa->sa_flags & SRVADDR_ISDOWN))
+           || ((adown==AFS_LS_UP) && (sa->sa_flags & SRVADDR_ISDOWN)))
            continue;
 
        /* check vlserver with special code */