From 3a996b58dea74be4748446c63b7d3c4c631b1881 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 25 Oct 2012 14:31:14 -0400 Subject: [PATCH] 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 --- src/WINNT/afsrdr/kernel/lib/AFSCleanup.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WINNT/afsrdr/kernel/lib/AFSCleanup.cpp b/src/WINNT/afsrdr/kernel/lib/AFSCleanup.cpp index 0130c3db4d..3e370aba0a 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); }