From: Jeffrey Altman Date: Sat, 7 Jul 2007 00:20:38 +0000 (+0000) Subject: windows-afsd-misc-20070706 X-Git-Tag: BP-openafs-windows-kdfs-ifs~615 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=5e29856f7a079fbfb7d3331a1b57414413c0a484;p=packages%2Fo%2Fopenafs.git windows-afsd-misc-20070706 * Do not give back callbacks to down servers * Output more cm_scache_t data in afsd_alloc.log * call VolStatus_Service_Stopped after the service has stopped --- diff --git a/src/WINNT/afsd/afsd_service.c b/src/WINNT/afsd/afsd_service.c index 6180a891c..745f4499e 100644 --- a/src/WINNT/afsd/afsd_service.c +++ b/src/WINNT/afsd/afsd_service.c @@ -1408,9 +1408,6 @@ afsd_Main(DWORD argc, LPTSTR *argv) else LogEvent(EVENTLOG_INFORMATION_TYPE, MSG_SERVICE_STOPPING); - /* Notify any Volume Status Handlers that we are stopping */ - cm_VolStatus_Service_Stopped(); - /* allow an exit to be called prior to stopping the service */ hHookDll = LoadLibrary(AFSD_HOOK_DLL); if (hHookDll) @@ -1478,6 +1475,9 @@ afsd_Main(DWORD argc, LPTSTR *argv) PowerNotificationThreadExit(); #endif + /* Notify any Volume Status Handlers that we are stopped */ + cm_VolStatus_Service_Stopped(); + /* Cleanup any Volume Status Notification Handler */ cm_VolStatus_Finalize(); diff --git a/src/WINNT/afsd/cm_callback.c b/src/WINNT/afsd/cm_callback.c index 9863ad1f9..6228a8d6e 100644 --- a/src/WINNT/afsd/cm_callback.c +++ b/src/WINNT/afsd/cm_callback.c @@ -1792,7 +1792,7 @@ cm_GiveUpAllCallbacks(cm_server_t *tsp) cm_conn_t *connp; struct rx_connection * rxconnp; - if (tsp->type == CM_SERVER_FILE) { + if (tsp->type == CM_SERVER_FILE && !(tsp->flags & CM_SERVERFLAG_DOWN)) { code = cm_ConnByServer(tsp, cm_rootUserp, &connp); if (code == 0) { rxconnp = cm_GetRxConn(connp); diff --git a/src/WINNT/afsd/cm_scache.c b/src/WINNT/afsd/cm_scache.c index c1163699f..5f6937fc9 100644 --- a/src/WINNT/afsd/cm_scache.c +++ b/src/WINNT/afsd/cm_scache.c @@ -1615,38 +1615,40 @@ int cm_DumpSCache(FILE *outputFile, char *cookie, int lock) { int zilch; cm_scache_t *scp; - char output[1024]; + char output[2048]; int i; if (lock) lock_ObtainRead(&cm_scacheLock); - sprintf(output, "%s - dumping scache - cm_data.currentSCaches=%d, cm_data.maxSCaches=%d\r\n", cookie, cm_data.currentSCaches, cm_data.maxSCaches); + sprintf(output, "%s - dumping all scache - cm_data.currentSCaches=%d, cm_data.maxSCaches=%d\r\n", cookie, cm_data.currentSCaches, cm_data.maxSCaches); WriteFile(outputFile, output, (DWORD)strlen(output), &zilch, NULL); for (scp = cm_data.allSCachesp; scp; scp = scp->allNextp) { - sprintf(output, "%s scp=0x%p, fid (cell=%d, volume=%d, vnode=%d, unique=%d) volp=0x%p flags=0x%x refCount=%u\r\n", + sprintf(output, "%s scp=0x%p, fid (cell=%d, volume=%d, vnode=%d, unique=%d) volp=0x%p type=%d dv=%d len=0x%I64x mp='%s' flags=0x%x cb=0x%x refCount=%u\r\n", cookie, scp, scp->fid.cell, scp->fid.volume, scp->fid.vnode, scp->fid.unique, - scp->volp, scp->flags, scp->refCount); + scp->volp, scp->fileType, scp->dataVersion, scp->length.QuadPart, scp->mountPointStringp, scp->flags, + (unsigned long)scp->cbExpires, scp->refCount); WriteFile(outputFile, output, (DWORD)strlen(output), &zilch, NULL); } - sprintf(output, "%s - dumping cm_data.hashTable - cm_data.scacheHashTableSize=%d\r\n", cookie, cm_data.scacheHashTableSize); + sprintf(output, "%s - Done dumping all scache.\r\n", cookie); + WriteFile(outputFile, output, (DWORD)strlen(output), &zilch, NULL); + sprintf(output, "%s - dumping cm_data.scacheHashTable - cm_data.scacheHashTableSize=%d\r\n", cookie, cm_data.scacheHashTableSize); WriteFile(outputFile, output, (DWORD)strlen(output), &zilch, NULL); for (i = 0; i < cm_data.scacheHashTableSize; i++) { for(scp = cm_data.scacheHashTablep[i]; scp; scp=scp->nextp) { - sprintf(output, "%s scp=0x%p, hash=%d, fid (cell=%d, volume=%d, vnode=%d, unique=%d) volp=0x%p flags=0x%x refCount=%u\r\n", - cookie, scp, i, scp->fid.cell, scp->fid.volume, scp->fid.vnode, - scp->fid.unique, scp->volp, scp->flags, scp->refCount); + sprintf(output, "%s scp=0x%p, hash=%d, fid (cell=%d, volume=%d, vnode=%d, unique=%d)\r\n", + cookie, scp, i, scp->fid.cell, scp->fid.volume, scp->fid.vnode, scp->fid.unique); WriteFile(outputFile, output, (DWORD)strlen(output), &zilch, NULL); } } - sprintf(output, "%s - Done dumping scache.\r\n", cookie); + sprintf(output, "%s - Done dumping cm_data.scacheHashTable\r\n", cookie); WriteFile(outputFile, output, (DWORD)strlen(output), &zilch, NULL); if (lock) diff --git a/src/WINNT/afsd/cm_volstat.h b/src/WINNT/afsd/cm_volstat.h index 834c0898c..69b30adae 100644 --- a/src/WINNT/afsd/cm_volstat.h +++ b/src/WINNT/afsd/cm_volstat.h @@ -15,7 +15,7 @@ extern long cm_VolStatus_Finalize(void); extern long cm_VolStatus_Service_Started(void); -extern long cm_VolStatus_Service_Stopping(void); +extern long cm_VolStatus_Service_Stopped(void); #ifdef _WIN64 extern long cm_VolStatus_Network_Started(const char * netbios32, const char * netbios64);