Windows: Directory validation should purge data changes immediately

During AFSEnumerateDirectory() and AFSVerifyDirectoryContent() calls
use AFSPerformObjectInvalidate() instead of AFSInvalidateObject()
to trigger the data purge.  This is necessary to avoid a race as
AFSInvalidateObject() will queue a work request that will be performed
after the metadata is updated.

Change-Id: Iaf09c6448927a037175cb4a83502fd4a1d210ef2
Reviewed-on: http://gerrit.openafs.org/7279
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
This commit is contained in:
Jeffrey Altman 2012-04-23 20:18:20 -04:00 committed by Jeffrey Altman
parent 76f2e07fd0
commit d4c9cbc75e
2 changed files with 16 additions and 16 deletions

View File

@ -643,6 +643,10 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
if( BooleanFlagOn( pFcb->Flags, AFS_FCB_FLAG_PURGE_ON_CLOSE))
{
//
// The ObjectReferenceCount will be freed by AFSPerformObjectInvalidate
//
InterlockedIncrement( &pObjectInfo->ObjectReferenceCount);
ClearFlag( pFcb->Flags, AFS_FCB_FLAG_PURGE_ON_CLOSE);

View File

@ -306,16 +306,14 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
LONG lCount;
AFSObjectInfoCB *pObjectInfo = pDirNode->ObjectInformation;
//
// The ObjectReferenceCount will be freed by AFSPerformObjectInvalidate
//
lCount = InterlockedIncrement( &pObjectInfo->ObjectReferenceCount);
AFSInvalidateObject( &pObjectInfo,
AFS_INVALIDATE_DATA_VERSION);
if( pObjectInfo != NULL)
{
lCount = InterlockedDecrement( &pObjectInfo->ObjectReferenceCount);
}
AFSPerformObjectInvalidate( pObjectInfo,
AFS_INVALIDATE_DATA_VERSION);
}
else
{
@ -1070,16 +1068,14 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
if( pObjectInfo->DataVersion.QuadPart != pCurrentDirEntry->DataVersion.QuadPart)
{
//
// The ObjectReferenceCount will be freed by AFSPerformObjectInvalidate
//
lCount = InterlockedIncrement( &pObjectInfo->ObjectReferenceCount);
AFSInvalidateObject( &pObjectInfo,
AFS_INVALIDATE_DATA_VERSION);
if( pObjectInfo != NULL)
{
lCount = InterlockedDecrement( &pObjectInfo->ObjectReferenceCount);
}
AFSPerformObjectInvalidate( pObjectInfo,
AFS_INVALIDATE_DATA_VERSION);
}
else
{