windows-shutdown-20090628
authorJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 29 Jun 2009 04:27:41 +0000 (04:27 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 29 Jun 2009 04:27:41 +0000 (04:27 +0000)
LICENSE MIT

short circuit on-going offline volume checks once a shutdown has begun.

src/WINNT/afsd/cm_daemon.c
src/WINNT/afsd/cm_volume.c

index e511561..63e5c89 100644 (file)
@@ -45,7 +45,7 @@ int cm_bkgWaitingForCount;    /* true if someone's waiting for cm_bkgQueueCount to
 cm_bkgRequest_t *cm_bkgListp;          /* first elt in the list of requests */
 cm_bkgRequest_t *cm_bkgListEndp;       /* last elt in the list of requests */
 
-static int daemon_ShutdownFlag = 0;
+int daemon_ShutdownFlag = 0;
 static int cm_nDaemons = 0;
 static time_t lastIPAddrChange = 0;
 
index cc6b802..17b6cd1 100644 (file)
@@ -1297,9 +1297,10 @@ void cm_CheckOfflineVolumes(void)
 {
     cm_volume_t *volp;
     afs_int32 refCount;
+    extern int daemon_ShutdownFlag;
 
     lock_ObtainRead(&cm_volumeLock);
-    for (volp = cm_data.allVolumesp; volp; volp=volp->allNextp) {
+    for (volp = cm_data.allVolumesp; volp && !daemon_ShutdownFlag; volp=volp->allNextp) {
         if (volp->flags & CM_VOLUMEFLAG_IN_HASH) {
             InterlockedIncrement(&volp->refCount);
             lock_ReleaseRead(&cm_volumeLock);