From 23c920066976ac5ede41dd799c84d97ff5174c4c Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sat, 6 Oct 2012 17:36:25 -0400 Subject: [PATCH] Windows: AFSRequestExtentsAsync and AFSDoExtentsMapRegion When calling AFSDoExtentsMapRegion() the FCB ExtentsResource must be held. AFSRequestExtentsAsync() failed to hold the ExtentsResource across the call. Change-Id: I607cfb45725410c7f079b3be03002b002fccbea4 Reviewed-on: http://gerrit.openafs.org/8220 Tested-by: BuildBot Tested-by: Jeffrey Altman Reviewed-by: Jeffrey Altman --- .../afsrdr/kernel/lib/AFSExtentsSupport.cpp | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/WINNT/afsrdr/kernel/lib/AFSExtentsSupport.cpp b/src/WINNT/afsrdr/kernel/lib/AFSExtentsSupport.cpp index 2650de6011..ccf13c07d5 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSExtentsSupport.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSExtentsSupport.cpp @@ -750,9 +750,31 @@ AFSRequestExtentsAsync( IN AFSFcb *Fcb, // Check if we are already mapped // + AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING, + AFS_TRACE_LEVEL_VERBOSE, + "AFSRequestExtentsAsync Acquiring Fcb extents lock %08lX SHARED %08lX\n", + &pNPFcb->Specific.File.ExtentsResource, + PsGetCurrentThread()); + + AFSAcquireShared( &pNPFcb->Specific.File.ExtentsResource, TRUE ); + bRegionMapped = AFSDoExtentsMapRegion( Fcb, Offset, Size, &pFirstExtent, &pExtent); if( bRegionMapped) + { + + KeClearEvent( &pNPFcb->Specific.File.ExtentsRequestComplete ); + } + + AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING, + AFS_TRACE_LEVEL_VERBOSE, + "AFSRequestExtentsAsync Releasing Fcb extents lock %08lX SHARED %08lX\n", + &pNPFcb->Specific.File.ExtentsResource, + PsGetCurrentThread()); + + AFSReleaseResource( &pNPFcb->Specific.File.ExtentsResource ); + + if ( bRegionMapped) { try_return( ntStatus = STATUS_SUCCESS);