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

update put_inode handler for swapping situation deadlock avoidance

(cherry picked from commit b21c13dc3ab751118220dc31276995050841a1ae)

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

index 762c309ce3ecc0773bec8eeeff2481a89ed07185..030614e310cc376553afcf186e6348550f98aca2 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 a854fdbef04ee26561155e2f8e3b82f7b1c80402..4c30af603410f6984855e90e09d743e6386b0b1b 100644 (file)
@@ -825,8 +825,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);