diff mbox series

nfsd: return error if nfs4_setacl fails

Message ID 20221107115841.26380-1-jlayton@kernel.org (mailing list archive)
State New, archived
Headers show
Series nfsd: return error if nfs4_setacl fails | expand

Commit Message

Jeff Layton Nov. 7, 2022, 11:58 a.m. UTC
With the addition of POSIX ACLs to struct nfsd_attrs, we no longer
return an error if setting the ACL fails. Ensure we return the na_aclerr
error on SETATTR if there is one.

Fixes: c0cbe70742f4 ("NFSD: add posix ACLs to struct nfsd_attrs")
Cc: Neil Brown <neilb@suse.de>
Reported-by: Yongcheng Yang <yoyang@redhat.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/nfsd/nfs4proc.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Chuck Lever Nov. 7, 2022, 2:21 p.m. UTC | #1
> On Nov 7, 2022, at 6:58 AM, Jeff Layton <jlayton@kernel.org> wrote:
> 
> With the addition of POSIX ACLs to struct nfsd_attrs, we no longer
> return an error if setting the ACL fails. Ensure we return the na_aclerr
> error on SETATTR if there is one.
> 
> Fixes: c0cbe70742f4 ("NFSD: add posix ACLs to struct nfsd_attrs")
> Cc: Neil Brown <neilb@suse.de>
> Reported-by: Yongcheng Yang <yoyang@redhat.com>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>

Applied to nfsd's for-next tree (6.2). Thanks!


> ---
> fs/nfsd/nfs4proc.c | 2 ++
> 1 file changed, 2 insertions(+)
> 
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index 6f7e0c5e62d2..a6173677b766 100644
> --- a/fs/nfsd/nfs4proc.c
> +++ b/fs/nfsd/nfs4proc.c
> @@ -1135,6 +1135,8 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
> 				0, (time64_t)0);
> 	if (!status)
> 		status = nfserrno(attrs.na_labelerr);
> +	if (!status)
> +		status = nfserrno(attrs.na_aclerr);
> out:
> 	nfsd_attrs_free(&attrs);
> 	fh_drop_write(&cstate->current_fh);
> -- 
> 2.38.1
> 

--
Chuck Lever
diff mbox series

Patch

diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 6f7e0c5e62d2..a6173677b766 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1135,6 +1135,8 @@  nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 				0, (time64_t)0);
 	if (!status)
 		status = nfserrno(attrs.na_labelerr);
+	if (!status)
+		status = nfserrno(attrs.na_aclerr);
 out:
 	nfsd_attrs_free(&attrs);
 	fh_drop_write(&cstate->current_fh);