|
@@ -3767,25 +3767,17 @@ static nfsd4_enc nfsd4_enc_ops[] = {
|
|
|
__be32 nfsd4_check_resp_size(struct nfsd4_compoundres *resp, u32 respsize)
|
|
|
{
|
|
|
struct xdr_buf *buf = &resp->rqstp->rq_res;
|
|
|
- struct nfsd4_session *session = resp->cstate.session;
|
|
|
+ struct nfsd4_slot *slot = resp->cstate.slot;
|
|
|
|
|
|
- if (nfsd4_has_session(&resp->cstate)) {
|
|
|
- struct nfsd4_slot *slot = resp->cstate.slot;
|
|
|
-
|
|
|
- if (buf->len + respsize > session->se_fchannel.maxresp_sz)
|
|
|
- return nfserr_rep_too_big;
|
|
|
-
|
|
|
- if ((slot->sl_flags & NFSD4_SLOT_CACHETHIS) &&
|
|
|
- buf->len + respsize > session->se_fchannel.maxresp_cached)
|
|
|
- return nfserr_rep_too_big_to_cache;
|
|
|
- }
|
|
|
-
|
|
|
- if (buf->len + respsize > buf->buflen) {
|
|
|
- WARN_ON_ONCE(nfsd4_has_session(&resp->cstate));
|
|
|
+ if (buf->len + respsize <= buf->buflen)
|
|
|
+ return nfs_ok;
|
|
|
+ if (!nfsd4_has_session(&resp->cstate))
|
|
|
return nfserr_resource;
|
|
|
+ if (slot->sl_flags & NFSD4_SLOT_CACHETHIS) {
|
|
|
+ WARN_ON_ONCE(1);
|
|
|
+ return nfserr_rep_too_big_to_cache;
|
|
|
}
|
|
|
-
|
|
|
- return 0;
|
|
|
+ return nfserr_rep_too_big;
|
|
|
}
|
|
|
|
|
|
void
|