libafs: Flush vcaches in afs_shutdown
[openafs.git] / src / afs / afs_call.c
index 0ed56ef..8d972dd 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
@@ -1367,12 +1367,22 @@ afs_shutdown(void)
     if (afs_shuttingdown)
        return;
 
+    /* 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
        afs_warn("afs: WARM ");
-    afs_warn("shutting down of: CB... ");
+    afs_warn("shutting down of: vcaches... ");
+
+    afs_FlushAllVCaches();
+
+    afs_warn("CB... ");
 
     afs_termState = AFSOP_STOP_RXCALLBACK;
     rx_WakeupServerProcs();