linux-dentry-iput-20060813
authorChas Williams <chas@cmf.nrl.navy.mil>
Sun, 13 Aug 2006 17:53:46 +0000 (17:53 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sun, 13 Aug 2006 17:53:46 +0000 (17:53 +0000)
FIXES 37576

update put_inode handler for swapping situation deadlock avoidance

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

index 762c309..030614e 100644 (file)
@@ -350,23 +350,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
@@ -452,7 +435,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 0c3157e..59bb582 100644 (file)
@@ -827,8 +827,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);