When closing file handles, do not permit dirty extents to be
released back to the service if the current handle (Ccb) does
not have write permission. The cleanup operation will fail with
STATUS_ACCESS_DENIED, the extents will be released and all of the
dirty data will be discarded.
Change-Id: Iceacf5319147d1bd6277ea160bc67d91f1a49d5b
Reviewed-on: http://gerrit.openafs.org/6500
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
else
{
- if( pFcb->Header.NodeTypeCode == AFS_FILE_FCB)
+ if( pFcb->Header.NodeTypeCode == AFS_FILE_FCB &&
+ pFcb->Specific.File.ExtentsDirtyCount &&
+ (pCcb->GrantedAccess & FILE_WRITE_DATA))
{
- if( pFcb->Specific.File.ExtentsDirtyCount)
- {
-
- AFSFlushExtents( pFcb,
- &pCcb->AuthGroup);
- }
+ AFSFlushExtents( pFcb,
+ &pCcb->AuthGroup);
}
AFSReleaseResource( &pFcb->NPFcb->Resource);