From: Jeffrey Altman Date: Thu, 25 Oct 2012 18:31:14 +0000 (-0400) Subject: Windows: AFSCleanup Flush Data decision X-Git-Tag: upstream/1.8.0_pre1^2~1883 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=3a996b58dea74be4748446c63b7d3c4c631b1881;p=packages%2Fo%2Fopenafs.git Windows: AFSCleanup Flush Data decision 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 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/WINNT/afsrdr/kernel/lib/AFSCleanup.cpp b/src/WINNT/afsrdr/kernel/lib/AFSCleanup.cpp index 0130c3db4..3e370aba0 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSCleanup.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSCleanup.cpp @@ -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); }