]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
properly mark servers down for rx errors except OPCODE
authorDerrick Brashear <shadow@dementia.org>
Mon, 6 Dec 2010 18:55:22 +0000 (13:55 -0500)
committerDerrick Brashear <shadow@dementia.org>
Tue, 7 Dec 2010 02:24:47 +0000 (18:24 -0800)
if we get a negative (rx) error, it means the server is down,
*except* for RXGEN_OPCODE. make this handling consistent
(cherry picked from commit be770d4336c2fd7b8a83f18577ae6bb23a3f3e99)

Change-Id: I97f161e19140591c304e748eead8dcc46852f94a
Reviewed-on: http://gerrit.openafs.org/3456
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/afs/afs_server.c

index 3e461e1f6547b96ee036da4e4c96889a9a5b2641..20859e9f26aba728269b0f0bdcf1c3120471b764 100644 (file)
@@ -725,11 +725,11 @@ afs_CheckServers(int adown, struct cell *acellp)
          afs_osi_Wakeup(&afs_waitForever);
        }
       } else {
-       if (results[i] < 0) {
-         /* server crashed */
-         afs_ServerDown(sa);
-         ForceNewConnections(sa);  /* multi homed clients */
-       }
+         if ((results[i] < 0) && (results[i] != RXGEN_OPCODE)) {
+             /* server crashed */
+             afs_ServerDown(sa);
+             ForceNewConnections(sa);  /* multi homed clients */
+         }
       }
     }
 
@@ -1714,7 +1714,13 @@ afs_GetCapabilities(struct server *ts)
     ReleaseWriteLock(&afs_xserver);
     code = RXAFS_GetCapabilities(tc->id, &caps);
     ObtainWriteLock(&afs_xserver, 723);
-    afs_PutConn(tc, SHARED_LOCK);
+    /* we forced a conn above; important we mark it down if needed */
+    if ((code < 0) && (code != RXGEN_OPCODE)) {
+       afs_PutConn(tc, SHARED_LOCK);
+       afs_ServerDown(tc->parent->srvr);
+       ForceNewConnections(tc->parent->srvr); /* multi homed clients */
+    }
+
     if ( code && code != RXGEN_OPCODE ) {
        afs_warn("RXAFS_GetCapabilities failed with code %d\n", code);
        /* better not be anything to free. we failed! */