]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitf89bab5f07092e28075ead9172d36875c579c8e9
tree17fd443e8c826a601742d107e81d90e5b1be5940
parente7b31392c66574d0b7973a9d9e16789b49f65866
nfsd3: Check write permission after checking existence

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>
fs/nfsd/nfs3proc.c