From 05be212fea360747dbe5a9681ca81459b3d6ac62 Mon Sep 17 00:00:00 2001 From: Rainer Toebbicke Date: Thu, 24 Apr 2003 14:37:15 +0000 Subject: [PATCH] viced-shutdown-avoid-deadlock-20030424 don't deadlock on H_LOCK if we need to shut down in an emergency --- src/viced/callback.c | 8 ++++---- src/viced/viced.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/viced/callback.c b/src/viced/callback.c index f3c3af9f3..11348a197 100644 --- a/src/viced/callback.c +++ b/src/viced/callback.c @@ -445,7 +445,7 @@ static int CDel(struct CallBack *cb, int deletefe) assert(0); ViceLog(0,("CDel: Internal Error -- shutting down: wanted %d from %d, now at %d\n",cbi,fe->firstcb,*cbp)); DumpCallBackState(); - ShutDown(); + ShutDownAndCore(PANIC); } } CDelPtr(fe, cbp, deletefe); @@ -488,7 +488,7 @@ static afs_uint32 *FindCBPtr(struct FileEntry *fe, struct host *host) if (safety > cbstuff.nblks) { ViceLog(0,("FindCBPtr: Internal Error -- shutting down.\n")); DumpCallBackState(); - ShutDown(); + ShutDownAndCore(PANIC); } cb = itocb(*cbp); if (cb->hhead == hostindex) @@ -674,7 +674,7 @@ static int AddCallBack1_r(struct host *host, AFSFid *fid, afs_uint32 *thead, if (safety > cbstuff.nblks) { ViceLog(0,("AddCallBack1: Internal Error -- shutting down.\n")); DumpCallBackState(); - ShutDown(); + ShutDownAndCore(PANIC); } if (cb->hhead == h_htoi(host)) break; @@ -1460,7 +1460,7 @@ int CleanupTimedOutCallBacks_r(void) if (ntimedout > cbstuff.nblks) { ViceLog(0,("CCB: Internal Error -- shutting down...\n")); DumpCallBackState(); - ShutDown(); + ShutDownAndCore(PANIC); } } while (cbi != *thead); *thead = 0; diff --git a/src/viced/viced.c b/src/viced/viced.c index fc5370fd3..c3a378363 100644 --- a/src/viced/viced.c +++ b/src/viced/viced.c @@ -589,7 +589,7 @@ void ShutDownAndCore(int dopanic) } #endif DFlush(); - PrintCounters(); + if (!dopanic) PrintCounters(); /* do not allows new reqests to be served from now on, all new requests are returned with an error code of RX_RESTARTING ( transient failure ) */ -- 2.39.5