NFSD: Map nfserr_wrongsec outside of nfsd_dispatch

Refactor: Handle this NFS version-specific mapping in the only
place where nfserr_wrongsec is generated.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
Chuck Lever 2020-10-01 19:00:00 -04:00 committed by J. Bruce Fields
parent 14168d678a
commit 4b74fd793a
2 changed files with 1 additions and 3 deletions

View File

@ -1002,7 +1002,7 @@ __be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp)
if (nfsd4_spo_must_allow(rqstp))
return 0;
return nfserr_wrongsec;
return rqstp->rq_vers < 4 ? nfserr_acces : nfserr_wrongsec;
}
/*

View File

@ -964,8 +964,6 @@ static __be32 map_new_errors(u32 vers, __be32 nfserr)
{
if (nfserr == nfserr_jukebox && vers == 2)
return nfserr_dropit;
if (nfserr == nfserr_wrongsec && vers < 4)
return nfserr_acces;
return nfserr;
}