2020-10-10 23:00:59

by Chuck Lever III

[permalink] [raw]
Subject: [PATCH] NFSD: Fix oversight in .pc_func conversion

nfsd_proc_setattr() needs to return an accept_stat value, not an
nfserr status code, when fh_verify() fails.

Signed-off-by: Chuck Lever <[email protected]>
---
fs/nfsd/nfsproc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Oops.

diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
index f2450c719032..0d71549f9d42 100644
--- a/fs/nfsd/nfsproc.c
+++ b/fs/nfsd/nfsproc.c
@@ -85,7 +85,7 @@ nfsd_proc_setattr(struct svc_rqst *rqstp)

resp->status = fh_verify(rqstp, fhp, 0, NFSD_MAY_NOP);
if (resp->status != nfs_ok)
- return resp->status;
+ goto out;

if (delta < 0)
delta = -delta;



2020-10-12 14:32:59

by J. Bruce Fields

[permalink] [raw]
Subject: Re: [PATCH] NFSD: Fix oversight in .pc_func conversion

On Sat, Oct 10, 2020 at 03:43:15PM -0400, Chuck Lever wrote:
> nfsd_proc_setattr() needs to return an accept_stat value, not an
> nfserr status code, when fh_verify() fails.

Thanks! I'll fold that into "NFSD: Hoist status code encoding into XDR
encoder functions".

--b.

>
> Signed-off-by: Chuck Lever <[email protected]>
> ---
> fs/nfsd/nfsproc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Oops.
>
> diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
> index f2450c719032..0d71549f9d42 100644
> --- a/fs/nfsd/nfsproc.c
> +++ b/fs/nfsd/nfsproc.c
> @@ -85,7 +85,7 @@ nfsd_proc_setattr(struct svc_rqst *rqstp)
>
> resp->status = fh_verify(rqstp, fhp, 0, NFSD_MAY_NOP);
> if (resp->status != nfs_ok)
> - return resp->status;
> + goto out;
>
> if (delta < 0)
> delta = -delta;
>