vnop-remove-revised-lock-order-20060225
authorHartmut Reuter <reuter@rzg.mpg.de>
Sat, 25 Feb 2006 06:39:20 +0000 (06:39 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sat, 25 Feb 2006 06:39:20 +0000 (06:39 +0000)
FIXES 27176

drop the tdc lock even rearlier

src/afs/VNOPS/afs_vnop_remove.c

index 928e41e..dfb7d32 100644 (file)
@@ -349,6 +349,8 @@ afs_remove(OSI_VC_ARG(adp), aname, acred)
     if (tvc && osi_Active(tvc)) {
        /* about to delete whole file, prefetch it first */
        ReleaseWriteLock(&adp->lock);
+       if (tdc)
+           ReleaseSharedLock(&tdc->lock);
        ObtainWriteLock(&tvc->lock, 143);
 #if    defined(AFS_OSF_ENV)
        afs_Wire(tvc, &treq);
@@ -356,8 +358,6 @@ afs_remove(OSI_VC_ARG(adp), aname, acred)
        FetchWholeEnchilada(tvc, &treq);
 #endif
        ReleaseWriteLock(&tvc->lock);
-       if (tdc) 
-           ReleaseSharedLock(&tdc->lock);
        ObtainWriteLock(&adp->lock, 144);
        /* Technically I don't think we need this back, but let's hold it 
           anyway; The "got" reference should actually be sufficient. */