From: Chas Williams Date: Sun, 13 Aug 2006 17:50:43 +0000 (+0000) Subject: STABLE14-linux-dentry-iput-20060813 X-Git-Tag: openafs-stable-1_4_2rc1~16 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=544358cd9aec9bc31c976183bbb8f3f1cb11ec97;p=packages%2Fo%2Fopenafs.git STABLE14-linux-dentry-iput-20060813 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) --- diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c index 8227d4152..172bd4bef 100644 --- a/src/afs/LINUX/osi_vfsops.c +++ b/src/afs/LINUX/osi_vfsops.c @@ -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) diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 93a3f2f70..e0fa52606 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -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);