Message ID | 1437570209-29832-35-git-send-email-andreas.gruenbacher@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c index 4439ac4..e6a1744 100644 --- a/net/sunrpc/xdr.c +++ b/net/sunrpc/xdr.c @@ -537,6 +537,14 @@ static __be32 *xdr_get_next_encode_buffer(struct xdr_stream *xdr, */ xdr->scratch.iov_base = xdr->p; xdr->scratch.iov_len = frag1bytes; + + if (!*xdr->page_ptr) { + struct page *page = alloc_page(GFP_NOFS); + if (!page) + return NULL; + *xdr->page_ptr = page; + } + p = page_address(*xdr->page_ptr); /* * Note this is where the next encode will start after we've