nfsd: Return EPERM, not EACCES, in some SETATTR cases
authorzhengbin <zhengbin13@huawei.com>
Fri, 30 Nov 2018 08:04:25 +0000 (16:04 +0800)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 5 Dec 2018 01:48:07 +0000 (20:48 -0500)
commit255fbca65137e25b12bced18ec9a014dc77ecda0
tree51884812c0e497b5b409ed4ede85ece15aa94a50
parent4ecd55ea074217473f94cfee21bb72864d39f8d7
nfsd: Return EPERM, not EACCES, in some SETATTR cases

As the man(2) page for utime/utimes states, EPERM is returned when the
second parameter of utime or utimes is not NULL, the caller's effective UID
does not match the owner of the file, and the caller is not privileged.

However, in a NFS directory mounted from knfsd, it will return EACCES
(from nfsd_setattr-> fh_verify->nfsd_permission).  This patch fixes
that.

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