From: Trond Myklebust Date: Wed, 1 Aug 2012 18:32:13 +0000 (-0400) Subject: SUNRPC: Fix the return value of xdr_align_pages() X-Git-Tag: next-20120924~104^2~33 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f4dc7c1f0ca76d206b7b0fe80c626cfb55b6614d;p=karo-tx-linux.git 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: Trond Myklebust --- diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c index 0afba1b4b656..fbbd1c475b43 100644 --- a/net/sunrpc/xdr.c +++ b/net/sunrpc/xdr.c @@ -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; }