Skip to content

Commit

Permalink
NFSD: Map nfserr_wrongsec outside of nfsd_dispatch
Browse files Browse the repository at this point in the history
Refactor: Handle this NFS version-specific mapping in the only
place where nfserr_wrongsec is generated.

Signed-off-by: Chuck Lever <[email protected]>
Signed-off-by: J. Bruce Fields <[email protected]>
  • Loading branch information
chucklever authored and J. Bruce Fields committed Oct 2, 2020
1 parent 14168d6 commit 4b74fd7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion fs/nfsd/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/*
Expand Down
2 changes: 0 additions & 2 deletions fs/nfsd/nfssvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4b74fd7

Please sign in to comment.