From 0e3380edaeea6cdabe6d64c46c033ebee405cef3 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Thu, 13 Feb 2003 06:44:28 +0000 Subject: [PATCH] host-tossstuff-require-unlocked-20030211 add warning and don't clean up if host is locked. shouldn't be able to happen ==================== This delta was composed from multiple commits as part of the CVS->Git migration. The checkin message with each commit was inconsistent. The following are the additional commit messages. ==================== FIXES 1294 and make it useful --- src/viced/host.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/viced/host.c b/src/viced/host.c index 93292baf1..d8d43111d 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -682,7 +682,7 @@ struct host *h_LookupUuid_r(afsUUID *uuidp) */ /* h_TossStuff_r: Toss anything in the host structure (the host or - * clients marked for deletion. Called from r_Release ONLY. + * clients marked for deletion. Called from h_Release_r ONLY. * To be called, there must be no holds, and either host->deleted * or host->clientDeleted must be set. */ @@ -696,6 +696,16 @@ int h_TossStuff_r(register struct host *host) if (i!=h_maxSlots) return; + /* if somebody still has this host locked */ + if (h_NBLock_r(host) != 0) { + char hoststr[16]; + ViceLog(0, ("Warning: h_TossStuff_r failed; Host %s:%d was locked.\n", + afs_inet_ntoa_r(host->host, hoststr), host->port)); + return; + } else { + h_Unlock_r(host); + } + /* ASSUMPTION: r_FreeConnection() does not yield */ for (cp = &host->FirstClient; (client = *cp); ) { if ((host->hostFlags & HOSTDELETED) || client->deleted) { -- 2.39.5