]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-find-dcache-just-hold-the-lock-slightly-longer-20070820
authorDerrick Brashear <shadow@dementia.org>
Mon, 20 Aug 2007 18:53:15 +0000 (18:53 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 20 Aug 2007 18:53:15 +0000 (18:53 +0000)
we go out of our way to hold xdcache to protect indexTimes elsewhere... there's
no reason to drop it here just before this...

(cherry picked from commit d0a92c7bdeeac96a0d09e02a1494ff398f57f1bb)

src/afs/afs_dcache.c

index df04a5a5f571f889f67936a724f647b803fe7c69..b4101852be26923588a62a93ca178df86805e86f 100644 (file)
@@ -1201,14 +1201,14 @@ afs_FindDCache(register struct vcache *avc, afs_size_t abyte)
        }
        index = afs_dcnextTbl[index];
     }
-    MReleaseWriteLock(&afs_xdcache);
     if (index != NULLIDX) {
        hset(afs_indexTimes[tdc->index], afs_indexCounter);
        hadd32(afs_indexCounter, 1);
+       MReleaseWriteLock(&afs_xdcache);
        return tdc;
-    } else
-       return NULL;
-
+    } 
+    MReleaseWriteLock(&afs_xdcache);
+    return NULL;
 }                              /*afs_FindDCache */