Windows: Avoid deadlock in invalidation path
authorJeffrey Altman <jaltman@your-file-system.com>
Fri, 2 Mar 2012 15:52:35 +0000 (10:52 -0500)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 3 Mar 2012 23:20:42 +0000 (15:20 -0800)
commitfdf1dfc5f92fcd149a7ae0945e4458993b2ad61e
treea68825888177bbf37aeb525a10b56ca22f78eea6
parent81a9a33e0bc5455841ba105dab52735c64c7096b
Windows: Avoid deadlock in invalidation path

During data version invalidation the AFS redirector must CcPurge
any non-dirty extents on a file. This operation can be intercepted
by a filter driver which in turn might open the file and close it
again before the CcPurge completes.

The AFSPerformObjectInvalidate call holds the ExtentsResource
shared which can deadlock if AFSClose attempts an extent tear down
which requires exclusive access to the ExtentsResource.

Change-Id: I7cb0289d8036aabf56bb11fd12a79308be45faa8
Reviewed-on: http://gerrit.openafs.org/6856
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
src/WINNT/afsrdr/common/AFSRedirCommonDefines.h
src/WINNT/afsrdr/kernel/lib/AFSExtentsSupport.cpp
src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp
src/WINNT/afsrdr/kernel/lib/Include/AFSCommon.h
src/WINNT/afsrdr/kernel/lib/Include/AFSStructs.h