]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
NFS/localio: Deal with page bases that are > PAGE_SIZE
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 2 Jan 2026 23:55:08 +0000 (18:55 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Jan 2026 10:21:14 +0000 (11:21 +0100)
[ Upstream commit 60699ab7cbf0a4eb19929cce243002b39c67917d ]

When resending requests, etc, the page base can quickly grow larger than
the page size.

Fixes: 091bdcfcece0 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/localio.c

index ed2a7efaf8f20cf4064a6dbec0b434a7f3727749..f537bc3386bf269246f7d622d13e03e120bb797d 100644 (file)
@@ -461,6 +461,8 @@ nfs_local_iters_init(struct nfs_local_kiocb *iocb, int rw)
        v = 0;
        total = hdr->args.count;
        base = hdr->args.pgbase;
+       pagevec += base >> PAGE_SHIFT;
+       base &= ~PAGE_MASK;
        while (total && v < hdr->page_array.npages) {
                len = min_t(size_t, total, PAGE_SIZE - base);
                bvec_set_page(&iocb->bvec[v], *pagevec, len, base);