]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
afs: Slight restructuring in afs_Analyze
authorAndrew Deason <adeason@sinenomine.net>
Wed, 14 Nov 2012 00:15:21 +0000 (18:15 -0600)
committerPaul Smeddle <paul.smeddle@gmail.com>
Wed, 5 Dec 2012 09:54:46 +0000 (01:54 -0800)
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.

Reviewed-on: http://gerrit.openafs.org/8461
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit db57dfd3798f09e77b5c49bed304cacc0c448f91)

Change-Id: Idd836a5acba775c82f360ea1082ba50cc32914af
Reviewed-on: http://gerrit.openafs.org/8549
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Hans-Werner Paulsen <hans@MPA-Garching.MPG.DE>
Tested-by: Hans-Werner Paulsen <hans@MPA-Garching.MPG.DE>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
src/afs/afs_analyze.c

index b7f4aea9f656d25fce2f70584fa933ddd690fea6..a5281d7574692c91a3521cfdcc988f7bf8a53309 100644 (file)
@@ -627,43 +627,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);
        ForceNewConnections(sa); /**multi homed clients lock:afs_xsrvAddr? */
        if (aerrP)