Skip to content

Commit 7bafbd4

Browse files
committed
Merge tag 'nfsd-6.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
Pull nfsd fix from Chuck Lever: - Fix tmpfs splice read support * tag 'nfsd-6.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: nfsd: Fix reading via splice
2 parents 556c942 + 101df45 commit 7bafbd4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

fs/nfsd/vfs.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -956,10 +956,13 @@ nfsd_splice_actor(struct pipe_inode_info *pipe, struct pipe_buffer *buf,
956956
last_page = page + (offset + sd->len - 1) / PAGE_SIZE;
957957
for (page += offset / PAGE_SIZE; page <= last_page; page++) {
958958
/*
959-
* Skip page replacement when extending the contents
960-
* of the current page.
959+
* Skip page replacement when extending the contents of the
960+
* current page. But note that we may get two zero_pages in a
961+
* row from shmem.
961962
*/
962-
if (page == *(rqstp->rq_next_page - 1))
963+
if (page == *(rqstp->rq_next_page - 1) &&
964+
offset_in_page(rqstp->rq_res.page_base +
965+
rqstp->rq_res.page_len))
963966
continue;
964967
if (unlikely(!svc_rqst_replace_page(rqstp, page)))
965968
return -EIO;

0 commit comments

Comments
 (0)