OpenAFS Master Repository branch, openafs-stable-1_4_x, updated. b21d0930e56a3331cd94c30a07e9d8fdebdcd5c4
Gerrit Code Review
Wed, 16 Dec 2009 23:00:47 -0800 (PST)
The following commit has been merged in the openafs-stable-1_4_x branch:
Author: Simon Wilkinson <firstname.lastname@example.org>
Date: Mon Oct 26 17:06:20 2009 +0000
Fix locking in afs_buffer.c
Back in 2002, 0eb68f307aac84472a13523a0ce8b7a865f01ac7 was committed
to fix locking problems in dir/buffer.c.
Sadly, similar changes were never made to afs/afs_buffer.c, so the
same problems remain in the cache manager.
The issue here is with two processes racing in afs_newslot. Calls to
afs_newslot protect buffers with a zero reference count using
afs_bufferLock. If we release afs_bufferLock, before we increase the
reference count of the vcache, then we can end up with newslot
picking the same buffer for two different purposes.
The GLOCK actually protects us from the worst of this, but this fix
is necessary both for correctness, and for symmetry with the file
server buffer code.
Reviewed-by: Derrick Brashear <email@example.com>
Tested-by: Derrick Brashear <firstname.lastname@example.org>
(cherry picked from commit b21b209f1cb2bafe916543c1ac8f232d6fc84847)
src/afs/afs_buffer.c | 28 +++++++++++++++++++++-------
1 files changed, 21 insertions(+), 7 deletions(-)
OpenAFS Master Repository