Windows: QFileInfo only Verify Entry when necessary
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 29 Nov 2012 08:14:42 +0000 (03:14 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Mon, 3 Dec 2012 22:05:59 +0000 (14:05 -0800)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp

index 2935d17..f9ffcdf 100644 (file)
@@ -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