From db57dfd3798f09e77b5c49bed304cacc0c448f91 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Tue, 13 Nov 2012 18:15:21 -0600 Subject: [PATCH] afs: Slight restructuring in afs_Analyze We test for acode < 0 && acode != VRESTARTING, but then immediately test for specific values for acode. Move this conditional down, and remove a level of indentation for the next couple of acode checks. This commit should introduce no functional change. Change-Id: I2ca3a00d5f6d620fcb042d8007f18dd8b5cfaf24 Reviewed-on: http://gerrit.openafs.org/8461 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Reviewed-by: Derrick Brashear --- src/afs/afs_analyze.c | 60 +++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/afs/afs_analyze.c b/src/afs/afs_analyze.c index 255556061..34db88f1c 100644 --- a/src/afs/afs_analyze.c +++ b/src/afs/afs_analyze.c @@ -613,43 +613,43 @@ afs_Analyze(struct afs_conn *aconn, struct rx_connection *rxconn, afs_PutVolume(tvp, READ_LOCK); } - /* If network troubles, mark server as having bogued out again. */ - /* VRESTARTING is < 0 because of backward compatibility issues - * with 3.4 file servers and older cache managers */ #ifdef AFS_64BIT_CLIENT if (acode == -455) acode = 455; #endif /* AFS_64BIT_CLIENT */ - if ((acode < 0) && (acode != VRESTARTING)) { - if (acode == RX_MSGSIZE || acode == RX_CALL_BUSY) { + if (acode == RX_MSGSIZE || acode == RX_CALL_BUSY) { + shouldRetry = 1; + goto out; + } + if (acode == RX_CALL_TIMEOUT || acode == RX_CALL_IDLE) { + serversleft = afs_BlackListOnce(areq, afid, tsp); + if (afid) + tvp = afs_FindVolume(afid, READ_LOCK); + if ((serversleft == 0) && tvp && + ((tvp->states & VRO) || (tvp->states & VBackup))) { + shouldRetry = 0; + } else { shouldRetry = 1; - goto out; } - if (acode == RX_CALL_TIMEOUT || acode == RX_CALL_IDLE) { - serversleft = afs_BlackListOnce(areq, afid, tsp); - if (afid) - tvp = afs_FindVolume(afid, READ_LOCK); - if ((serversleft == 0) && tvp && - ((tvp->states & VRO) || (tvp->states & VBackup))) { - shouldRetry = 0; - } else { - shouldRetry = 1; - } - if (!afid || !tvp || (tvp->states & VRO)) - areq->idleError++; - else if (afs_ClearStatus(afid, op, tvp) == 0) - shouldRetry = 0; + if (!afid || !tvp || (tvp->states & VRO)) + areq->idleError++; + else if (afs_ClearStatus(afid, op, tvp) == 0) + shouldRetry = 0; - if (tvp) - afs_PutVolume(tvp, READ_LOCK); - /* By doing this, we avoid ever marking a server down - * in an idle timeout case. That's because the server is - * still responding and may only be letting a single vnode - * time out. We otherwise risk having the server continually - * be marked down, then up, then down again... - */ - goto out; - } + if (tvp) + afs_PutVolume(tvp, READ_LOCK); + /* By doing this, we avoid ever marking a server down + * in an idle timeout case. That's because the server is + * still responding and may only be letting a single vnode + * time out. We otherwise risk having the server continually + * be marked down, then up, then down again... + */ + goto out; + } + /* If network troubles, mark server as having bogued out again. */ + /* VRESTARTING is < 0 because of backward compatibility issues + * with 3.4 file servers and older cache managers */ + if ((acode < 0) && (acode != VRESTARTING)) { afs_ServerDown(sa, acode, rxconn); ForceNewConnections(sa); /* multi homed clients lock:afs_xsrvAddr? */ if (aerrP) -- 2.39.5