From be27d61961cb490e3f1033d9e0943d2655b73b8a Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 29 Nov 2012 03:14:42 -0500 Subject: [PATCH] Windows: QFileInfo only Verify Entry when necessary During a QueryFileInformation request only call AFSVerifyEntry() when the AFS_OBJECT_FLAGS_VERIFY flag is set on the ObjectInformationCB. The AFS_OBJECT_FLAGS_VERIFY flag is set in response to an invalidation event from the cache manager. Let the cache manager decide when our data is no longer consistent with the file server. Change-Id: I299597577f9fb13d008e20aff7a404ad6c2185b5 Reviewed-on: http://gerrit.openafs.org/8568 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp | 29 ++++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp b/src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp index 2935d17cd..f9ffcdf7c 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp @@ -94,15 +94,30 @@ AFSQueryFileInfo( IN PDEVICE_OBJECT LibDeviceObject, stFileInformationClass = pIrpSp->Parameters.QueryFile.FileInformationClass; pBuffer = Irp->AssociatedIrp.SystemBuffer; - RtlZeroMemory( &stAuthGroup, - sizeof( GUID)); + if ( BooleanFlagOn( pFcb->ObjectInformation->Flags, AFS_OBJECT_FLAGS_VERIFY)) + { + + RtlZeroMemory( &stAuthGroup, + sizeof( GUID)); + + AFSRetrieveAuthGroupFnc( (ULONGLONG)PsGetCurrentProcessId(), + (ULONGLONG)PsGetCurrentThreadId(), + &stAuthGroup); + + ntStatus = AFSVerifyEntry( &stAuthGroup, + pCcb->DirectoryCB); + + if ( NT_SUCCESS( ntStatus)) + { - AFSRetrieveAuthGroupFnc( (ULONGLONG)PsGetCurrentProcessId(), - (ULONGLONG)PsGetCurrentThreadId(), - &stAuthGroup); + ClearFlag( pFcb->ObjectInformation->Flags, AFS_OBJECT_FLAGS_VERIFY); + } + else + { - AFSVerifyEntry( &stAuthGroup, - pCcb->DirectoryCB); + ntStatus = STATUS_SUCCESS; + } + } // // Grab the main shared right off the bat -- 2.39.5