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>
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 2df639f..94a7fce 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1539,7 +1539,8 @@
#endif
goto out;
}
- }
+ } else
+ new_inode->i_nlink--;
go_ahead:
/*