NFSD: map fh_verify() status codes for NFS_ACLv3 replies

The NFS_ACLv3 protocol shares its status code space with NFSv3,
which has NFS3ERR_BADHANDLE but no NFSERR_NOFILEHANDLE. An
NFS_ACLv3 GETACL or SETACL request that carries an empty file
handle gets a reply with status 10020, a value the client cannot
interpret.

Commit 1459ad5767 ("nfsd: Move error code mapping to per-version
proc code.") made fh_verify() return nfserr_nofilehandle for an
empty handle regardless of protocol version. The NFSv3 procedures
gained nfsd3_map_status() in exchange, but the NFS_ACLv3 procedures
did not, so the unmapped status reaches the encoder.

Add the same mapping to the NFS_ACLv3 procedures.

Fixes: 1459ad5767 ("nfsd: Move error code mapping to per-version proc code.")
Cc: stable@vger.kernel.org
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20260916004240.141975-2-cel@kernel.org
Signed-off-by: Chuck Lever <cel@kernel.org>
This commit is contained in:
Chuck Lever 2026-09-15 20:42:40 -04:00
parent ccfc4db5ab
commit b1eb9f1aea

View File

@ -14,6 +14,19 @@
#include "xdr3.h"
#include "vfs.h"
static __be32 nfsd3_map_status(__be32 status)
{
switch (status) {
case nfserr_nofilehandle:
status = nfserr_badhandle;
break;
case nfserr_wrongsec:
status = nfserr_acces;
break;
}
return status;
}
/*
* NULL call.
*/
@ -72,6 +85,7 @@ static __be32 nfsd3_proc_getacl(struct svc_rqst *rqstp)
/* resp->acl_{access,default} are released in nfs3svc_release_getacl. */
out:
resp->status = nfsd3_map_status(resp->status);
return rpc_success;
fail:
@ -125,6 +139,7 @@ static __be32 nfsd3_proc_setacl(struct svc_rqst *rqstp)
resp->status = nfserrno(error);
out:
/* argp->acl_{access,default} are released in nfs3svc_release_setacl. */
resp->status = nfsd3_map_status(resp->status);
return rpc_success;
}