]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
nfsd: return error if nfs4_setacl fails
authorJeff Layton <jlayton@kernel.org>
Mon, 7 Nov 2022 11:58:41 +0000 (06:58 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:19:23 +0000 (16:19 +0200)
[ Upstream commit 01d53a88c08951f88f2a42f1f1e6568928e0590e ]

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>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4proc.c

index 92d4eb1032ff9adac85641a4169e5dac93c84407..eeff0ba0be55845b15ce84a7ec9d2760a2939d65 100644 (file)
@@ -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);