From: Jeffrey Altman Date: Thu, 29 Nov 2012 08:14:42 +0000 (-0500) Subject: Windows: QFileInfo only Verify Entry when necessary X-Git-Tag: upstream/1.8.0_pre1^2~1752 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=be27d61961cb490e3f1033d9e0943d2655b73b8a;p=packages%2Fo%2Fopenafs.git 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 --- 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