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 <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
This commit is contained in:
Jeffrey Altman 2012-10-25 14:31:14 -04:00
parent ea2f25372c
commit 3a996b58de

View File

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