NFS: Fix a race in sillyrename
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 15 Oct 2007 22:17:53 +0000 (18:17 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 19 Oct 2007 21:19:16 +0000 (17:19 -0400)
commit565277f63c616e11c37309a1e98c052d18ebbb55
tree60fdddc5a1c97df696392e47ead71d33d39e487f
parent61e930a904966cc37e0a3404276f0b73037e57ca
NFS: Fix a race in sillyrename

lookup() and sillyrename() can race one another because the sillyrename()
completion cannot take the parent directory's inode->i_mutex since the
latter may be held by whoever is calling dput().

We therefore have little option but to add extra locking to ensure that
nfs_lookup() and nfs_atomic_open() do not race with the sillyrename
completion.
If somebody has looked up the sillyrenamed file in the meantime, we just
transfer the sillydelete information to the new dentry.

Please refer to the bug-report at
http://bugzilla.linux-nfs.org/show_bug.cgi?id=150

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/dir.c
fs/nfs/inode.c
fs/nfs/nfs4proc.c
fs/nfs/unlink.c
include/linux/nfs_fs.h