Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Windows: Avoid deadlock on ProcessTree Lock

Reviewed-on: http://gerrit.openafs.org/7505
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit ce8d0ae)

Change-Id: Id7e9ba86dd886c8160ac967fa44e657bfc603258
Reviewed-on: http://gerrit.openafs.org/7511
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
  • Loading branch information...
commit 053f2253ffbbd9b576a5b4c46b3df3e4d500bf9e 1 parent 5254a3a
@jaltman jaltman authored jaltman committed
Showing with 31 additions and 15 deletions.
  1. +31 −15 src/WINNT/afsrdr/kernel/fs/AFSProcessSupport.cpp
View
46 src/WINNT/afsrdr/kernel/fs/AFSProcessSupport.cpp
@@ -290,25 +290,41 @@ AFSValidateProcessEntry( IN HANDLE ProcessId)
pProcessCB == NULL)
{
- AFSProcessCreate( 0,
- ProcessId,
- 0,
- 0);
- }
+ AFSReleaseResource( pDeviceExt->Specific.Control.ProcessTree.TreeLock);
- if( !NT_SUCCESS( ntStatus) ||
- pProcessCB == NULL)
- {
+ AFSAcquireExcl( pDeviceExt->Specific.Control.ProcessTree.TreeLock,
+ TRUE);
- AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
- AFS_TRACE_LEVEL_ERROR,
- "%s Failed to locate process entry for ProcessID %I64X\n",
- __FUNCTION__,
- ullProcessID);
+ ntStatus = AFSLocateHashEntry( pDeviceExt->Specific.Control.ProcessTree.TreeHead,
+ ullProcessID,
+ (AFSBTreeEntry **)&pProcessCB);
- AFSReleaseResource( pDeviceExt->Specific.Control.ProcessTree.TreeLock);
+ if( !NT_SUCCESS( ntStatus) ||
+ pProcessCB == NULL)
+ {
+
+ AFSProcessCreate( 0,
+ ProcessId,
+ 0,
+ 0);
+ }
+
+ if( !NT_SUCCESS( ntStatus) ||
+ pProcessCB == NULL)
+ {
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_AUTHGROUP_PROCESSING,
+ AFS_TRACE_LEVEL_ERROR,
+ "%s Failed to locate process entry for ProcessID %I64X\n",
+ __FUNCTION__,
+ ullProcessID);
+
+ AFSReleaseResource( pDeviceExt->Specific.Control.ProcessTree.TreeLock);
+
+ try_return( ntStatus = STATUS_UNSUCCESSFUL);
+ }
- try_return( ntStatus = STATUS_UNSUCCESSFUL);
+ AFSConvertToShared( pDeviceExt->Specific.Control.ProcessTree.TreeLock);
}
//
Please sign in to comment.
Something went wrong with that request. Please try again.