From: Chas Williams Date: Sun, 13 Aug 2006 17:53:46 +0000 (+0000) Subject: linux-dentry-iput-20060813 X-Git-Tag: BP-openafs-windows-kdfs-ifs~1097 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=b21c13dc3ab751118220dc31276995050841a1ae;p=packages%2Fo%2Fopenafs.git linux-dentry-iput-20060813 FIXES 37576 update put_inode handler for swapping situation deadlock avoidance --- diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c index 762c309ce..030614e31 100644 --- a/src/afs/LINUX/osi_vfsops.c +++ b/src/afs/LINUX/osi_vfsops.c @@ -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) diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 0c3157e39..59bb58239 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -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);