提交 8a9a8b83 编写于 作者: T Trond Myklebust

SUNRPC: Fix the return value of xdr_align_pages()

The callers of xdr_align_pages() expect it to return the number of bytes
of actual XDR data remaining in the pages.
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 62d98c93
...@@ -742,6 +742,8 @@ static unsigned int xdr_align_pages(struct xdr_stream *xdr, unsigned int len) ...@@ -742,6 +742,8 @@ static unsigned int xdr_align_pages(struct xdr_stream *xdr, unsigned int len)
/* Truncate page data and move it into the tail */ /* Truncate page data and move it into the tail */
if (buf->page_len > len) if (buf->page_len > len)
xdr_shrink_pagelen(buf, buf->page_len - len); xdr_shrink_pagelen(buf, buf->page_len - len);
else
len = buf->page_len;
xdr->nwords = XDR_QUADLEN(buf->len - cur); xdr->nwords = XDR_QUADLEN(buf->len - cur);
return len; return len;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册