Windows: CcPurge range modified by non-cached write
authorJeffrey Altman <jaltman@your-file-system.com>
Tue, 9 Apr 2013 14:35:52 +0000 (10:35 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Tue, 9 Apr 2013 17:39:13 +0000 (10:39 -0700)
commitaa0046a7220d8b21f2694d7f9534d7383422731b
treeece7cdebfd35ea5be7706ec3cafa870fcb2f9819
parent7bb300ad2cfe2fec9698523c59a4e800b4fe635a
Windows: CcPurge range modified by non-cached write

When a non-cached non-paging write occurs, the update bypasses the
Windows cache.  As a result any cached data in the modified range is
now invalid and must be purged.

CcPurgeCacheSection is known to trigger some filter drivers to open
the file from a worker thread.  To avoid a deadlock on the
Fcb->NPFcb->Resource that resource must be dropped.  Holding the
SectionObjectResource exclusive is sufficient to protect against races
with other writes, reads and SetEndOfFile operations.  While purging the
cache prior to calling the service might be more desireable, it cannot be
done safely without violating the lock hierarchy.  Therefore, the purge is
performed after any call to the service completes.

Change-Id: I953a74a0675875eb6be85f85ce924473deb3347f
Reviewed-on: http://gerrit.openafs.org/9756
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp