Skip to content

Commit 5776a9c

Browse files
author
Trond Myklebust
committed
NFS: Fix a race in nfs_call_unlink()
We should check that the filehandles match before transferring the sillyrename data to the newly looked-up dentry in case the name was reused on the server. Signed-off-by: Trond Myklebust <[email protected]>
1 parent 35e3b6a commit 5776a9c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/nfs/unlink.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ static int nfs_call_unlink(struct dentry *dentry, struct inode *inode, struct nf
139139
*/
140140
spin_lock(&alias->d_lock);
141141
if (d_really_is_positive(alias) &&
142+
!nfs_compare_fh(NFS_FH(inode), NFS_FH(d_inode(alias))) &&
142143
!(alias->d_flags & DCACHE_NFSFS_RENAMED)) {
143144
devname_garbage = alias->d_fsdata;
144145
alias->d_fsdata = data;

0 commit comments

Comments
 (0)