ubik: Unlock version lock before udisk_end
authorAndrew Deason <adeason@sinenomine.net>
Tue, 14 Oct 2014 18:17:27 +0000 (13:17 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Tue, 2 Dec 2014 22:57:00 +0000 (17:57 -0500)
commit4103aee514615c46e919202fb7842b9b2e254ff9
tree5556aa0cb093f2e0d4ba249913fd85d441293712
parentb19bb7db413de426984f6ddb79b7b97ea478ffaf
ubik: Unlock version lock before udisk_end

Currently, BeginTrans calls udisk_end with UBIK_VERSION_LOCK held when
it gets an error from DISK_Begin. However, udisk_end itself acquires
UBIK_VERSION_LOCK to update the database flags, so this causes a
deadlock.

So, unlock UBIK_VERSION_LOCK before calling udisk_end. Also unlock it
before calling DISK_Abort, udisk_abort, and DISK_Begin, as well, since
none of those modify fields protected by UBIK_VERSION_LOCK. (Any read
access is allowed because we DBHOLD the database.) This commit unlocks
the lock immediately after we are done modifying versioning
information, which is right after we change writeTidCounter for write
transactions.

Change-Id: I31343d67c82734ff88b76bec740ef16767bb9667
Reviewed-on: http://gerrit.openafs.org/11541
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
src/ubik/ubik.c