NFSD: Map nfserr_wrongsec outside of nfsd_dispatch
authorChuck Lever <chuck.lever@oracle.com>
Thu, 1 Oct 2020 23:00:00 +0000 (19:00 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 2 Oct 2020 13:37:42 +0000 (09:37 -0400)
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>
fs/nfsd/export.c
fs/nfsd/nfssvc.c

index cb777fe8298813e3a3d5196eb36ebe5da7ea8b57..21e404e7cb68c718c20f67f76714a26f14f1d4d0 100644 (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;
 }
 
 /*
index 4aa8db879ca2816c5214641f6604154b90c461ac..beb3875241cbc8998c024334eb443942c1784388 100644 (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;
 }