]> git.michaelhowe.org Git - packages/o/openafs.git/commit
FBSD: close race in afs_root
authorBen Kaduk <kaduk@mit.edu>
Sat, 6 Nov 2010 04:02:31 +0000 (00:02 -0400)
committerDerrick Brashear <shadow@dementia.org>
Mon, 10 Jan 2011 04:28:15 +0000 (20:28 -0800)
commit72e2b1119136315a5845c7af00aa73456985d6fa
tree64f4f6bb926021f4051696d867696a38dac00e9e
parent2da52a3b73ec84aef21284cd217aeaaf330fce00
FBSD: close race in afs_root

Previously, we called afs_PutVCache(afs_globalVp) directly.  This
is unsafe because PutVCache acquires locks which can sleep, losing
the serialization of the GLOCK.  In rare circumstances, this can
result in two threads simultaneously making that call, and the
second one would panic in vputx() with a negative refcount.
Close the race by using a local variable for the afs_PutVCache()
calls, applying the change to afs_globalVp before dropping the GLOCK.
While here, fix up other race conditions.

Change-Id: I4733489d50d3459172ee2eb021190d013f68018a
Reviewed-on: http://gerrit.openafs.org/3275
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-on: http://gerrit.openafs.org/3631
Tested-by: Derrick Brashear <shadow@dementia.org>
src/afs/FBSD/osi_vfsops.c