aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfsd/nfs4state.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index fe4ba68886d8..6a471af99dfd 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1762,6 +1762,14 @@ static bool nfsd4_session_too_many_ops(struct svc_rqst *rqstp, struct nfsd4_sess
1762 return args->opcnt > session->se_fchannel.maxops; 1762 return args->opcnt > session->se_fchannel.maxops;
1763} 1763}
1764 1764
1765static bool nfsd4_request_too_big(struct svc_rqst *rqstp,
1766 struct nfsd4_session *session)
1767{
1768 struct xdr_buf *xb = &rqstp->rq_arg;
1769
1770 return xb->len > session->se_fchannel.maxreq_sz;
1771}
1772
1765__be32 1773__be32
1766nfsd4_sequence(struct svc_rqst *rqstp, 1774nfsd4_sequence(struct svc_rqst *rqstp,
1767 struct nfsd4_compound_state *cstate, 1775 struct nfsd4_compound_state *cstate,
@@ -1794,6 +1802,10 @@ nfsd4_sequence(struct svc_rqst *rqstp,
1794 if (nfsd4_session_too_many_ops(rqstp, session)) 1802 if (nfsd4_session_too_many_ops(rqstp, session))
1795 goto out; 1803 goto out;
1796 1804
1805 status = nfserr_req_too_big;
1806 if (nfsd4_request_too_big(rqstp, session))
1807 goto out;
1808
1797 status = nfserr_badslot; 1809 status = nfserr_badslot;
1798 if (seq->slotid >= session->se_fchannel.maxreqs) 1810 if (seq->slotid >= session->se_fchannel.maxreqs)
1799 goto out; 1811 goto out;