From f21fa57453f4c94690c56cf4933b4eed82d99edc Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Wed, 13 Jul 2005 15:22:06 +0000 Subject: [PATCH 1/1] windows-aclent-deadlock-20050713 Discovered a deadlock due to a violation of lock order. We may not attempt to obtain a lock on a cm_scache_t mutex while holding the cm_aclLock. --- doc/txt/winnotes/afs-changes-since-1.2.txt | 5 +++++ src/WINNT/afsd/cm_aclent.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/doc/txt/winnotes/afs-changes-since-1.2.txt b/doc/txt/winnotes/afs-changes-since-1.2.txt index 85c6398..e867d03 100644 --- a/doc/txt/winnotes/afs-changes-since-1.2.txt +++ b/doc/txt/winnotes/afs-changes-since-1.2.txt @@ -1,3 +1,8 @@ +Since 1.3.85: + * Fixed a deadlock caused by the holder of cm_aclLock attempting to + obtain a mutex lock on a cm_scache_t object whose lock is held by + a thread attempting to obtain the cm_aclLock. + Since 1.3.84: * Added a new registry key, "LogoffPreserveTokens" (see registry.txt), that can be used to force the preservation of user tokens upon logout. diff --git a/src/WINNT/afsd/cm_aclent.c b/src/WINNT/afsd/cm_aclent.c index 52e635e..42a0c0a 100644 --- a/src/WINNT/afsd/cm_aclent.c +++ b/src/WINNT/afsd/cm_aclent.c @@ -127,7 +127,9 @@ static cm_aclent_t *GetFreeACLEnt(cm_scache_t * scp) if (aclp->backp && scp != aclp->backp) { ascp = aclp->backp; + lock_ReleaseWrite(&cm_aclLock); lock_ObtainMutex(&ascp->mx); + lock_ObtainWrite(&cm_aclLock); } CleanupACLEnt(aclp); -- 1.9.4