Commit a6cebd41 authored by Trond Myklebust's avatar Trond Myklebust Committed by Anna Schumaker

SUNRPC: Fix setting of buffer length in xdr_set_next_buffer()

Use xdr->nwords to tell us how much buffer remains.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent ace0e14f
...@@ -767,7 +767,7 @@ static void xdr_set_next_page(struct xdr_stream *xdr) ...@@ -767,7 +767,7 @@ static void xdr_set_next_page(struct xdr_stream *xdr)
newbase -= xdr->buf->page_base; newbase -= xdr->buf->page_base;
if (xdr_set_page_base(xdr, newbase, PAGE_SIZE) < 0) if (xdr_set_page_base(xdr, newbase, PAGE_SIZE) < 0)
xdr_set_iov(xdr, xdr->buf->tail, xdr->buf->len); xdr_set_iov(xdr, xdr->buf->tail, xdr->nwords << 2);
} }
static bool xdr_set_next_buffer(struct xdr_stream *xdr) static bool xdr_set_next_buffer(struct xdr_stream *xdr)
...@@ -776,7 +776,7 @@ static bool xdr_set_next_buffer(struct xdr_stream *xdr) ...@@ -776,7 +776,7 @@ static bool xdr_set_next_buffer(struct xdr_stream *xdr)
xdr_set_next_page(xdr); xdr_set_next_page(xdr);
else if (xdr->iov == xdr->buf->head) { else if (xdr->iov == xdr->buf->head) {
if (xdr_set_page_base(xdr, 0, PAGE_SIZE) < 0) if (xdr_set_page_base(xdr, 0, PAGE_SIZE) < 0)
xdr_set_iov(xdr, xdr->buf->tail, xdr->buf->len); xdr_set_iov(xdr, xdr->buf->tail, xdr->nwords << 2);
} }
return xdr->p != xdr->end; return xdr->p != xdr->end;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment