From: Simon Wilkinson Date: Mon, 25 Aug 2014 15:25:43 +0000 (+0100) Subject: ubik: Don't leak UBIK_VERSION_LOCK if udisk_LogEnd fails X-Git-Tag: upstream/1.8.0_pre1^2~589 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=11efae8362c5c73cdac19ef9f1c5e7f9c33883d8;p=packages%2Fo%2Fopenafs.git ubik: Don't leak UBIK_VERSION_LOCK if udisk_LogEnd fails If the call to udisk_LogEnd() fails (probably due to an I/O error) don't leak the UBIK_VERSION_LOCK. This is the possible cause of a vlserver deadlock, which had approximately 4800 threads blocked. Analysis of backtrace of all of these threads showed that all blocked threads were waiting in ubik.c:555 (blocked on DBHOLD) with the exception of: One in beacon.c:388 (blocked on UBIK_VERSION_LOCK) One in recovery.c:503 (blocked on DBHOLD) One in ubik.c:125 (blocked on DBHOLD) One in ubik.c:585 (blocked on UBIK_VERSION_LOCK) The last of these is the critical one, because it already holds the lock that DBHOLD waits on - so despite the vast majority of threads being blocked in DBHOLD, it's actually UBIK_VERSION_LOCK that we're waiting on. There is no sign of a thread which is still active which currently holds UBIK_VERSION_LOCK. Change-Id: I1627b448d359152237912d4d78c9fa52c7149aa0 Reviewed-on: http://gerrit.openafs.org/11427 Tested-by: BuildBot Reviewed-by: Perry Ruiter Reviewed-by: Chas Williams - CONTRACTOR Reviewed-by: Jeffrey Altman --- diff --git a/src/ubik/disk.c b/src/ubik/disk.c index b0da8dc66..f4434e9fc 100644 --- a/src/ubik/disk.c +++ b/src/ubik/disk.c @@ -910,7 +910,8 @@ udisk_commit(struct ubik_trans *atrans) code = udisk_LogEnd(dbase, &dbase->version); if (code) { dbase->version.counter--; - return (code); + UBIK_VERSION_UNLOCK; + return code; } UBIK_VERSION_UNLOCK;