Skip to content

Commit

Permalink
nfsd4: reject bad forechannel attrs earlier
Browse files Browse the repository at this point in the history
This could simplify the logic a little later.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
J. Bruce Fields committed Oct 1, 2012
1 parent d15c077 commit 4973050
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,8 @@ nfsd4_create_session(struct svc_rqst *rqstp,

if (cr_ses->flags & ~SESSION4_FLAG_MASK_A)
return nfserr_inval;
if (check_forechannel_attrs(cr_ses->fore_channel))
return nfserr_toosmall;

nfs4_lock_state();
unconf = find_unconfirmed_client(&cr_ses->clientid, true);
Expand Down Expand Up @@ -1811,10 +1813,6 @@ nfsd4_create_session(struct svc_rqst *rqstp,
cr_ses->flags &= ~SESSION4_PERSIST;
cr_ses->flags &= ~SESSION4_RDMA;

status = nfserr_toosmall;
if (check_forechannel_attrs(cr_ses->fore_channel))
goto out;

status = nfserr_jukebox;
new = alloc_init_session(rqstp, conf, cr_ses);
if (!new)
Expand Down

0 comments on commit 4973050

Please sign in to comment.