aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2005-08-25 19:25:34 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2005-09-23 12:37:58 -0400
commit20509f1bc553ed7fafa88fa8d01c6212d1876d9f (patch)
treeda10ad62009995269dc0733a254a0bc1f6293aa2
parent12f44f46bc9c6dc79255e661b085797af395d8da (diff)
NFS: Drop inode after rename
When doing a rename on top of an existing file that is not in use, the inode of the overwritten file will remain in the icache. The fix is to decrement i_nlink of the overwritten inode, like we do for unlink, rmdir etc already. Problem diagnosed by Olaf Kirch. This patch is a slight variation on his fix. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/dir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 2df639f143e8..94a7fcee0624 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1539,7 +1539,8 @@ static int nfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1539#endif 1539#endif
1540 goto out; 1540 goto out;
1541 } 1541 }
1542 } 1542 } else
1543 new_inode->i_nlink--;
1543 1544
1544go_ahead: 1545go_ahead:
1545 /* 1546 /*