Skip to content

Commit

Permalink
SUNRPC: Fix the return value of xdr_align_pages()
Browse files Browse the repository at this point in the history
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: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Sep 26, 2012
1 parent 62d98c9 commit 8a9a8b8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/sunrpc/xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
if (buf->page_len > len)
xdr_shrink_pagelen(buf, buf->page_len - len);
else
len = buf->page_len;
xdr->nwords = XDR_QUADLEN(buf->len - cur);
return len;
}
Expand Down

0 comments on commit 8a9a8b8

Please sign in to comment.