]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
nfsd: avoid permission checks on EXCLUSIVE_CREATE replay
authorNeil Brown <neilb@suse.de>
Fri, 7 Dec 2012 20:40:55 +0000 (15:40 -0500)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 3 Jan 2013 03:33:35 +0000 (03:33 +0000)
commit65ad4f419b64f0f7768cb564fee61667737c6b5c
treed15e7281b9f48069a6619b2a669c7f076893f686
parent3d66fd735d84acb52b09fd5c441e3b206cd226a5
nfsd: avoid permission checks on EXCLUSIVE_CREATE replay

commit 7007c90fb9fef593b4aeaeee57e6a6754276c97c upstream.

With NFSv4, if we create a file then open it we explicit avoid checking
the permissions on the file during the open because the fact that we
created it ensures we should be allow to open it (the create and the
open should appear to be a single operation).

However if the reply to an EXCLUSIVE create gets lots and the client
resends the create, the current code will perform the permission check -
because it doesn't realise that it did the open already..

This patch should fix this.

Note that I haven't actually seen this cause a problem.  I was just
looking at the code trying to figure out a different EXCLUSIVE open
related issue, and this looked wrong.

(Fix confirmed with pynfs 4.0 test OPEN4--bfields)

Signed-off-by: NeilBrown <neilb@suse.de>
[bfields: use OWNER_OVERRIDE and update for 4.1]
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
[bwh: Backported to 3.2:
 - Adjust context
 - Use current_fh as file handle in do_open_lookup()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/nfsd/nfs4proc.c
fs/nfsd/vfs.c