Skip to content

Commit

Permalink
Merge tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/viro/vfs

Pull iov_iter fix from Al Viro:
 "Fix for a nfsd regression caused by the iov_iter stuff this window"

* tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  nfsd_splice_actor(): handle compound pages
  • Loading branch information
Linus Torvalds committed Sep 13, 2022
2 parents e839a75 + bfbfb61 commit d1221ce
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions fs/nfsd/vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -845,10 +845,14 @@ nfsd_splice_actor(struct pipe_inode_info *pipe, struct pipe_buffer *buf,
struct splice_desc *sd)
{
struct svc_rqst *rqstp = sd->u.data;

svc_rqst_replace_page(rqstp, buf->page);
if (rqstp->rq_res.page_len == 0)
rqstp->rq_res.page_base = buf->offset;
struct page *page = buf->page; // may be a compound one
unsigned offset = buf->offset;

page += offset / PAGE_SIZE;
for (int i = sd->len; i > 0; i -= PAGE_SIZE)
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;
return sd->len;
}
Expand Down

0 comments on commit d1221ce

Please sign in to comment.