Signed-off-by: J. Bruce Fields <bfields@redhat.com>
{
struct xdr_buf *buf = &resp->rqstp->rq_res;
struct nfsd4_session *session = resp->cstate.session;
- int slack_bytes = (char *)resp->xdr.end - (char *)resp->xdr.p;
if (nfsd4_has_session(&resp->cstate)) {
struct nfsd4_slot *slot = resp->cstate.slot;
return nfserr_rep_too_big_to_cache;
}
- if (respsize > slack_bytes) {
+ if (buf->len + respsize > buf->buflen) {
WARN_ON_ONCE(nfsd4_has_session(&resp->cstate));
return nfserr_resource;
}