aboutsummaryrefslogtreecommitdiff
path: root/fs/nfsd/vfs.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org> 2023-03-21 14:48:38 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org> 2023-03-21 14:48:38 -0700
commita2eaf246f5732519f3dcc34e18fd41909e226284 (patch)
treed8d3e98dac017bec6e43a09134bdb7739d566ac5 /fs/nfsd/vfs.c
parentMerge tag 'keys-fixes-20230321' of git://git.kernel.org/pub/scm/linux/kernel/... (diff)
parentnfsd: don't replace page in rq_pages if it's a continuation of last page (diff)
downloadlinux-a2eaf246f5732519f3dcc34e18fd41909e226284.tar.gz
linux-a2eaf246f5732519f3dcc34e18fd41909e226284.tar.bz2
linux-a2eaf246f5732519f3dcc34e18fd41909e226284.zip
Merge tag 'nfsd-6.3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
Pull nfsd fixes from Chuck Lever: - Fix a crash during NFS READs from certain client implementations - Address a minor kbuild regression in v6.3 * tag 'nfsd-6.3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: nfsd: don't replace page in rq_pages if it's a continuation of last page NFS & NFSD: Update GSS dependencies
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r--fs/nfsd/vfs.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 502e1b7742db..5783209f17fc 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -941,8 +941,15 @@ nfsd_splice_actor(struct pipe_inode_info *pipe, struct pipe_buffer *buf,
struct page *last_page;
last_page = page + (offset + sd->len - 1) / PAGE_SIZE;
- for (page += offset / PAGE_SIZE; page <= last_page; page++)
+ for (page += offset / PAGE_SIZE; page <= last_page; page++) {
+ /*
+ * Skip page replacement when extending the contents
+ * of the current page.
+ */
+ if (page == *(rqstp->rq_next_page - 1))
+ continue;
svc_rqst_replace_page(rqstp, page);
+ }
if (rqstp->rq_res.page_len == 0) // first call
rqstp->rq_res.page_base = offset % PAGE_SIZE;
rqstp->rq_res.page_len += sd->len;