libafs: GiveUpAllCallBacks at shutdown again
[openafs.git] / src / afs / afs_call.c
index 1db4b89..7400236 100644 (file)
@@ -1164,7 +1164,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
@@ -1366,9 +1366,14 @@ afs_shutdown(void)
 
     if (afs_shuttingdown)
        return;
-    afs_FlushVCBs(2);       /* Reasonable effort to free dynamically allocated callback returns */
+
+    /* Give up all of our callbacks if we can. This must be done before setting
+     * afs_shuttingdown, since it calls afs_InitReq, which will fail if
+     * afs_shuttingdown is set. */
+    afs_FlushVCBs(2);
 
     afs_shuttingdown = 1;
+
     if (afs_cold_shutdown)
        afs_warn("afs: COLD ");
     else