Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <trond.myklebust@hammerspace.com>

+1
+1
fs/nfs/unlink.c
··· 139 139 */ 140 140 spin_lock(&alias->d_lock); 141 141 if (d_really_is_positive(alias) && 142 + !nfs_compare_fh(NFS_FH(inode), NFS_FH(d_inode(alias))) && 142 143 !(alias->d_flags & DCACHE_NFSFS_RENAMED)) { 143 144 devname_garbage = alias->d_fsdata; 144 145 alias->d_fsdata = data;