]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-linux-dentry-iput-20060813
authorChas Williams <chas@cmf.nrl.navy.mil>
Sun, 13 Aug 2006 17:50:43 +0000 (17:50 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sun, 13 Aug 2006 17:50:43 +0000 (17:50 +0000)
FIXES 37576

update the put_inode handler on linux to avoid some possible deadlocks in situations where we need to swap

(cherry picked from commit b21c13dc3ab751118220dc31276995050841a1ae)

src/afs/LINUX/osi_vfsops.c
src/afs/LINUX/osi_vnodeops.c

index 8227d41521a8b0d8fa82ebe90c2a026beb861d67..172bd4bef0c77466aa964a67dbd3465ba2bbcaf8 100644 (file)
@@ -332,23 +332,6 @@ afs_clear_inode(struct inode *ip)
 #endif
 }
 
-/* afs_put_inode
- * Linux version of inactive.  When refcount == 2, we are about to
- * decrement to 1 and the only reference remaining should be for
- * the VLRU
- */
-
-static void
-afs_put_inode(struct inode *ip)
-{
-    struct vcache *vcp = VTOAFS(ip);
-
-    AFS_GLOCK();
-    if (VREFCOUNT(vcp) == 2) 
-       afs_InactiveVCache(vcp, NULL);
-    AFS_GUNLOCK();
-}
-
 /* afs_put_super
  * Called from unmount to release super_block. */
 static void
@@ -434,7 +417,6 @@ struct super_operations afs_sops = {
   .destroy_inode =     afs_destroy_inode,
 #endif
   .clear_inode =       afs_clear_inode,
-  .put_inode =         afs_put_inode,
   .put_super =         afs_put_super,
   .statfs =            afs_statfs,
 #if !defined(AFS_LINUX24_ENV)
index 93a3f2f70bb585f65dc3e01d1623724657aff350..e0fa52606f4aae8bfddfba7f9ea318f680ff2519 100644 (file)
@@ -809,8 +809,9 @@ afs_dentry_iput(struct dentry *dp, struct inode *ip)
     struct vcache *vcp = VTOAFS(ip);
 
     AFS_GLOCK();
-    if (vcp->states & CUnlinked)
-       (void) afs_InactiveVCache(vcp, NULL);
+    ObtainWriteLock(&vcp->lock, 537);
+    (void) afs_InactiveVCache(vcp, NULL);
+    ReleaseWriteLock(&vcp->lock);
     AFS_GUNLOCK();
 
     iput(ip);