nfsd3: Check write permission after checking existence
authorRoss Lagerwall <rosslagerwall@gmail.com>
Sat, 9 Aug 2014 13:44:00 +0000 (14:44 +0100)
committerJ. Bruce Fields <bfields@redhat.com>
Sun, 17 Aug 2014 16:00:14 +0000 (12:00 -0400)
When creating a file that already exists in a read-only directory with
O_EXCL, the NFSv3 server returns EACCES rather than EEXIST (which local
files and the NFSv4 server return).  Fix this by checking the MAY_CREATE
permission only if the file does not exist.  Since this already happens
in do_nfsd_create, the check in nfsd3_proc_create can simply be removed.

Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>

No differences found