]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-windows-aclent-deadlock-20050713
authorJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 13 Jul 2005 15:29:15 +0000 (15:29 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 13 Jul 2005 15:29:15 +0000 (15:29 +0000)
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.

(cherry picked from commit f21fa57453f4c94690c56cf4933b4eed82d99edc)

doc/txt/winnotes/afs-changes-since-1.2.txt
src/WINNT/afsd/cm_aclent.c

index 7ee09a1b6d64bc175a3b6c0a2317b222a1108c4d..9d4c2b55cdf18c15c2ccb1e0e905bc46b0840ca4 100644 (file)
@@ -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.
index 52e635e64ca07db13ac0315e578cda31ad9313e1..42a0c0ac6944cd16dc7d2d7cbde5e926eef4ebc8 100644 (file)
@@ -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);