Skip to content

Commit 60699ab

Browse files
author
Trond Myklebust
committed
NFS/localio: Deal with page bases that are > PAGE_SIZE
When resending requests, etc, the page base can quickly grow larger than the page size. Fixes: 091bdcf ("nfs/localio: refactor iocb and iov_iter_bvec initialization") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Reviewed-by: Mike Snitzer <snitzer@kernel.org>
1 parent 001945a commit 60699ab

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

fs/nfs/localio.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,8 @@ nfs_local_iters_init(struct nfs_local_kiocb *iocb, int rw)
461461
v = 0;
462462
total = hdr->args.count;
463463
base = hdr->args.pgbase;
464+
pagevec += base >> PAGE_SHIFT;
465+
base &= ~PAGE_MASK;
464466
while (total && v < hdr->page_array.npages) {
465467
len = min_t(size_t, total, PAGE_SIZE - base);
466468
bvec_set_page(&iocb->bvec[v], *pagevec, len, base);

0 commit comments

Comments
 (0)