Windows: AFSInvalidateVolume ObjectInfo refcnt decrement

In AFSInvalidateVolume a reference count is obtained in order to
ensure that the object is valid throughout the invalidation request.
Although the refcnt is obtained while holding the TreeLock the refcnt
was not released while holding the TreeLock which could open the door
for another thread to race.

Change-Id: I5c7ee91b78a2ce5f03cdc5f835b15357ecbec443
Reviewed-on: http://gerrit.openafs.org/9782
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
This commit is contained in:
Jeffrey Altman 2013-04-12 11:12:13 -04:00
parent a1aa06e82c
commit ed76e573ae

View File

@ -2759,6 +2759,9 @@ AFSInvalidateVolume( IN AFSVolumeCB *VolumeCB,
AFSInvalidateObject( &pCurrentObject,
Reason);
AFSAcquireShared( VolumeCB->ObjectInfoTree.TreeLock,
TRUE);
if ( pCurrentObject )
{
@ -2772,9 +2775,6 @@ AFSInvalidateVolume( IN AFSVolumeCB *VolumeCB,
lCount));
}
AFSAcquireShared( VolumeCB->ObjectInfoTree.TreeLock,
TRUE);
pCurrentObject = pNextObject;
}