OpenAFS Master Repository branch, master, updated. openafs-devel-1_5_76-3687-gba78ac6
Gerrit Code Review
Fri, 5 Apr 2013 19:28:58 -0700 (PDT)
The following commit has been merged in the master branch:
Author: Jeffrey Altman <firstname.lastname@example.org>
Date: Tue Apr 2 00:46:27 2013 -0400
Windows: AFSPrimaryVolumeWorkerThread reorg
Periodically there is a lost race which results in a valid DirectoryCB
with a non-NULL ObjectInformation pointer that refers to freed memory.
This major reorganization simplifies the logic and attempts to close
First, the AFSExamineDirectory() function is removed and replaced by
a call to AFSDeleteDirEntry(). The AFSExamineDirectory() function
examined all of the children AFSObjectInfoCB objects which in turn
duplicated much of the logic of AFSExamineObjInfo at the cost of
increased complexity due to the additional layer of locked objects.
Once the AFSDirectoryCB is removed a subsequent pass of the worker
thread will free the AFSObjectInfoCBs.
Second, the AFS_OBJECT_REFERENCE_DIRENTRY category had been used for
both DirectoryCB references and the Pioctl references. A new
AFS_OBJECT_REFERENCE_PIOCTL category has been created to improve the
ability to track the allocations and releases.
Third, the AFSPrimaryVolumeWorker thread now attempts to hold onto the
VolumeCB TreeLock exclusively. Previously the lock was held shared.
However, it is not safe for both the garbage collection and the find
routines to both be shared. One has to be exclusive. Although holding
the TreeLock exclusively in the garbage collection processing will result
in the lock being held for extended periods of time, it is more likely
that there will be benefits from parallel access during AFSFindObjectInfo()
Attempts to obtain most other locks are non-blocking. If the lock cannot
be obtained, the object must be in use. Therefore, it should not be
Tested-by: BuildBot <email@example.com>
Reviewed-by: Jeffrey Altman <firstname.lastname@example.org>
Tested-by: Jeffrey Altman <email@example.com>
src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp | 200 ++++---
src/WINNT/afsrdr/kernel/lib/AFSVolume.cpp | 18 +-
src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp | 681 ++++++++++------------
src/WINNT/afsrdr/kernel/lib/Include/AFSDefines.h | 3 +-
4 files changed, 425 insertions(+), 477 deletions(-)
OpenAFS Master Repository