Windows: Drop resource across AFSCleanupFcb
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 12 Mar 2012 19:53:47 +0000 (15:53 -0400)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 13 Mar 2012 23:34:54 +0000 (16:34 -0700)
Avoid additional deadlocks involving
VolumeCB->ObjectInfoTree.TreeLock.

Change-Id: Ibfeb8f230c54e95d3a0b7b9d84c63cb7f4b9ce2d
Reviewed-on: http://gerrit.openafs.org/6893
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/kernel/lib/AFSWorker.cpp

index b4adbec..6ad1031 100644 (file)
@@ -1534,9 +1534,14 @@ AFSPrimaryVolumeWorkerThread( IN PVOID Context)
                             if( pFcb != NULL)
                             {
 
+                                AFSReleaseResource( pVolumeCB->ObjectInfoTree.TreeLock);
+
                                 AFSCleanupFcb( pFcb,
                                                TRUE);
 
+                                AFSAcquireExcl( pVolumeCB->ObjectInfoTree.TreeLock,
+                                                TRUE);
+
                                 AFSRemoveFcb( &pFcb);
                             }
 
@@ -1565,8 +1570,13 @@ AFSPrimaryVolumeWorkerThread( IN PVOID Context)
                         else if( pCurrentObject->Fcb != NULL)
                         {
 
+                            AFSReleaseResource( pVolumeCB->ObjectInfoTree.TreeLock);
+
                             AFSCleanupFcb( pCurrentObject->Fcb,
                                            FALSE);
+
+                            AFSAcquireShared( pVolumeCB->ObjectInfoTree.TreeLock,
+                                              TRUE);
                         }
                     }