소스 검색

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 <Trond.Myklebust@netapp.com>
Trond Myklebust 13 년 전
부모
커밋
8a9a8b8332
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      net/sunrpc/xdr.c

+ 2 - 0
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;
 }