aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfsd/nfs4proc.c2
-rw-r--r--net/sunrpc/xdr.c9
2 files changed, 6 insertions, 5 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index f053c5a9ebf1..6851b003f2a4 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1264,7 +1264,7 @@ static void svcxdr_init_encode(struct svc_rqst *rqstp,
1264 /* Tail and page_len should be zero at this point: */ 1264 /* Tail and page_len should be zero at this point: */
1265 buf->len = buf->head[0].iov_len; 1265 buf->len = buf->head[0].iov_len;
1266 xdr->scratch.iov_len = 0; 1266 xdr->scratch.iov_len = 0;
1267 xdr->page_ptr = buf->pages; 1267 xdr->page_ptr = buf->pages - 1;
1268 buf->buflen = PAGE_SIZE * (1 + rqstp->rq_page_end - buf->pages) 1268 buf->buflen = PAGE_SIZE * (1 + rqstp->rq_page_end - buf->pages)
1269 - rqstp->rq_auth_slack; 1269 - rqstp->rq_auth_slack;
1270} 1270}
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
index 39928444c7fb..23fb4e75e245 100644
--- a/net/sunrpc/xdr.c
+++ b/net/sunrpc/xdr.c
@@ -523,10 +523,9 @@ __be32 *xdr_get_next_encode_buffer(struct xdr_stream *xdr, size_t nbytes)
523 frag2bytes = nbytes - frag1bytes; 523 frag2bytes = nbytes - frag1bytes;
524 if (xdr->iov) 524 if (xdr->iov)
525 xdr->iov->iov_len += frag1bytes; 525 xdr->iov->iov_len += frag1bytes;
526 else { 526 else
527 xdr->buf->page_len += frag1bytes; 527 xdr->buf->page_len += frag1bytes;
528 xdr->page_ptr++; 528 xdr->page_ptr++;
529 }
530 xdr->iov = NULL; 529 xdr->iov = NULL;
531 /* 530 /*
532 * If the last encode didn't end exactly on a page boundary, the 531 * If the last encode didn't end exactly on a page boundary, the
@@ -638,8 +637,10 @@ void xdr_truncate_encode(struct xdr_stream *xdr, size_t len)
638 /* xdr->iov should already be NULL */ 637 /* xdr->iov should already be NULL */
639 return; 638 return;
640 } 639 }
641 if (fraglen) 640 if (fraglen) {
642 xdr->end = head->iov_base + head->iov_len; 641 xdr->end = head->iov_base + head->iov_len;
642 xdr->page_ptr--;
643 }
643 /* (otherwise assume xdr->end is already set) */ 644 /* (otherwise assume xdr->end is already set) */
644 head->iov_len = len; 645 head->iov_len = len;
645 buf->len = len; 646 buf->len = len;