Windows: AFSCleanup Flush Data decision
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 25 Oct 2012 18:31:14 +0000 (14:31 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Sun, 28 Oct 2012 01:53:03 +0000 (18:53 -0700)
AFSCleanup() should instruct the cache manager to flush dirty
data when the Context Control Block indicates that the handle
being closed was opened for writing and was granted appropriate
permissions.   The decision to flush should not be dependent on
the open handle count because the last handle might belong to
an authentication group that does not have write permission.

Change-Id: I4e181616f1c8eba9e4c6184e2035d9f6cbaba1d0
Reviewed-on: http://gerrit.openafs.org/8306
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/AFSCleanup.cpp

index 0130c3d..3e370ab 100644 (file)
@@ -550,6 +550,8 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
 
                         AFSFlushExtents( pFcb,
                                          &pCcb->AuthGroup);
+
+                        ulNotificationFlags |= AFS_REQUEST_FLAG_FLUSH_FILE;
                     }
 
                     if( pFcb->OpenHandleCount == 1)
@@ -561,8 +563,6 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
 
                         AFSWaitOnQueuedFlushes( pFcb);
 
-                        ulNotificationFlags |= AFS_REQUEST_FLAG_FLUSH_FILE;
-
                         AFSTearDownFcbExtents( pFcb,
                                                &pCcb->AuthGroup);
                     }