OpenAFS Master Repository branch, openafs-devel-1_7_x, updated. openafs-devel-1_7_23-17-g7c589dd
Gerrit Code Review
gerrit@openafs.org
Sat, 6 Apr 2013 05:20:30 -0700 (PDT)
The following commit has been merged in the openafs-devel-1_7_x branch:
commit 7c589dd95f856c1f1e70b06825b1c0ff4fcb07c5
Author: Jeffrey Altman <jaltman@your-file-system.com>
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
potential loopholes.
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()
calls.
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
garbage collected.
Reviewed-on: http://gerrit.openafs.org/9720
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit ba78ac675c2a90359dedc9cf16e38e6d7e606eaf)
Change-Id: Ia72186a7406f24fe66d2a1dbefe562d91c2c14aa
Reviewed-on: http://gerrit.openafs.org/9737
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.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