From 4c4075ade0d46087638bd8cc96aa9fac005e62f3 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Thu, 5 May 2011 11:37:12 -0500 Subject: [PATCH] libafs: Correct afs_LoopServers flags 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 Tested-by: BuildBot (cherry picked from commit 1f48bc7a30d5df88a1e5f539ee22df3952533a88) Change-Id: Ibf56812134800a047642455a528dae488c52bcf9 Reviewed-on: http://gerrit.openafs.org/8309 Tested-by: BuildBot Reviewed-by: Andrew Deason --- src/afs/afs_call.c | 2 +- src/afs/afs_server.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c index c46d203f6..3d184b5d6 100644 --- a/src/afs/afs_call.c +++ b/src/afs/afs_call.c @@ -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 diff --git a/src/afs/afs_server.c b/src/afs/afs_server.c index 178169f45..8470ca6a2 100644 --- a/src/afs/afs_server.c +++ b/src/afs/afs_server.c @@ -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 */ -- 2.39.5