[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <716E1527-6C55-4A16-8330-DEF32BDAF4D1@oracle.com>
Date: Thu, 24 Nov 2022 18:31:02 +0000
From: Chuck Lever III <chuck.lever@...cle.com>
To: Anders Blomdell <anders.blomdell@...trol.lth.se>
CC: Jeff Layton <jlayton@...nel.org>,
Al Viro <viro@...iv.linux.org.uk>,
Linux NFS Mailing List <linux-nfs@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
"stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: Re: [PATCH v2 1/1] Make nfsd_splice_actor work with reads with a
non-zero offset that doesn't end on a page boundary
> On Nov 23, 2022, at 2:00 PM, Anders Blomdell <anders.blomdell@...trol.lth.se> wrote:
>
> Make nfsd_splice_actor work with reads with a non-zero offset that doesn't end on a page boundary.
>
> This was found when virtual machines with nfs-mounted qcow2 disks failed to boot properly (originally found
> on v6.0.5, fix also needed and tested on v6.0.9 and v6.1-rc6).
>
> Signed-off-by: Anders Blomdell <anders.blomdell@...trol.lth.se>
> Link: https://bugzilla.redhat.com/show_bug.cgi?id=2142132
> Fixes: bfbfb6182ad1 "nfsd_splice_actor(): handle compound pages"
> Cc: stable@...r.kernel.org # v6.0+
"b4 am" and other tooling failed to recognize the diff content in
this email, so I've applied Al's version to nfsd's for-rc, after
running some regression tests. See:
https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git/log/?h=for-rc
I will see that a pull request is sent to Linus before 6.1-rc7.
Thanks for reporting and chasing this down.
> -- a/fs/nfsd/vfs.c
> +++ b/fs/nfsd/vfs.c
> @@ -869,12 +869,13 @@ nfsd_splice_actor(struct pipe_inode_info *pipe, struct pipe_buffer *buf,
> struct splice_desc *sd)
> {
> struct svc_rqst *rqstp = sd->u.data;
> - struct page *page = buf->page; // may be a compound one
> + // buf->page may be a compound one
> unsigned offset = buf->offset;
> + struct page *first = buf->page + offset / PAGE_SIZE;
> + struct page *last = buf->page + (offset + sd->len - 1) / PAGE_SIZE;
>
> - page += offset / PAGE_SIZE;
> - for (int i = sd->len; i > 0; i -= PAGE_SIZE)
> - svc_rqst_replace_page(rqstp, page++);
> + for (struct page *page = first; page <= last; page++)
> + 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;
>
> --
> Anders Blomdell Email: anders.blomdell@...trol.lth.se
> Department of Automatic Control
> Lund University Phone: +46 46 222 4625
> P.O. Box 118
> SE-221 00 Lund, Sweden
--
Chuck Lever
Powered by blists - more mailing lists