]> Pileus Git - ~andy/linux/commit
nfsd4: fix delegation-unlink/rename race
authorJ. Bruce Fields <bfields@redhat.com>
Fri, 24 Jan 2014 23:04:40 +0000 (18:04 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 27 Jan 2014 18:59:16 +0000 (13:59 -0500)
commit4335723e8e9fdc6e4bb2555696bc7f1abe75f200
tree047598958f44c9865039f19b8f3d4abfc4b99065
parentc0e6bee480591a78caad5b13bd377948c025d0cd
nfsd4: fix delegation-unlink/rename race

If a file is unlinked or renamed between the time when we do the local
open and the time when we get the delegation, then we will return to the
client indicating that it holds a delegation even though the file no
longer exists under the name it was open under.

But a client performing an open-by-name, when it is returned a
delegation, must be able to assume that the file is still linked at the
name it was opened under.

So, hold the parent i_mutex for longer to prevent concurrent renames or
unlinks.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4proc.c
fs/nfsd/vfs.c