Linux NFS development
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Chuck Lever III <chuck.lever@oracle.com>
Cc: Benjamin Coddington <bcodding@redhat.com>,
	Olga Kornievskaia <aglo@umich.edu>,
	Jeff Layton <jlayton@kernel.org>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: Is this nfsd kernel oops known?
Date: Sun, 11 Sep 2022 20:39:30 +0100	[thread overview]
Message-ID: <Yx45clPaZODzYV+z@ZenIV> (raw)
In-Reply-To: <8B4DBE66-960F-473C-8636-8159B397FFC0@oracle.com>

On Sun, Sep 11, 2022 at 06:36:22PM +0000, Chuck Lever III wrote:

> > diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
> > index 9f486b788ed0..b16aed158ba6 100644
> > --- a/fs/nfsd/vfs.c
> > +++ b/fs/nfsd/vfs.c
> > @@ -846,10 +846,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;
> 
> Nit: I see "offset / PAGE_SIZE" is used in the iter code base,
> but in the NFS stack, we prefer "offset >> PAGE_SIZE" and
> "offset & ~PAGE_MASK" (below).

*shrug*

If a C compiler is too dumb to recognize division by a power of two
constant...

Anyway, your codebase, your rules.

> 
> > +	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;
> > }
> 
> I could take this through the nfsd for-rc tree, but that's based
> on 5.19-rc7 so it doesn't have f0f6b614f83d. I don't think will
> break functionality, but I'm wondering if it would be better for
> you to take this through your tree to improve bisect-ability.
> 
> If you agree and Ben reports a Tested-by:, then here's my
> 
>   Acked-by: Chuck Lever <chuck.lever@oracle.com>

OK, I'll wait for Tested-by and send it to Linus.  Should be safe
for backports - with non-compound pages we are going to have
offset < PAGE_SIZE and sd->len <= PAGE_SIZE, so this is equivalent
to the mainline variant of the function for those...

  reply	other threads:[~2022-09-11 19:39 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-30 17:14 Is this nfsd kernel oops known? Olga Kornievskaia
2022-08-30 17:49 ` Jeff Layton
2022-08-30 18:22   ` Olga Kornievskaia
2022-08-30 18:26     ` Chuck Lever III
2022-08-30 18:33       ` Olga Kornievskaia
2022-08-30 18:41         ` Chuck Lever III
2022-08-30 18:54           ` Olga Kornievskaia
2022-09-01 13:51   ` Olga Kornievskaia
2022-09-01 14:33     ` Benjamin Coddington
2022-09-01 20:08     ` Chuck Lever III
2022-09-02  1:27       ` Olga Kornievskaia
2022-09-02 20:58         ` Benjamin Coddington
2022-09-02 21:13           ` Chuck Lever III
2022-09-03  0:38             ` Benjamin Coddington
2022-09-03  3:34               ` Olga Kornievskaia
2022-09-03 16:41                 ` Chuck Lever III
2022-09-06 18:28         ` Benjamin Coddington
2022-09-06 19:12           ` Olga Kornievskaia
2022-09-07  4:58             ` Chuck Lever III
2022-09-07 12:52               ` Benjamin Coddington
2022-09-10 21:14                 ` Al Viro
2022-09-10 21:21                   ` Chuck Lever III
2022-09-10 22:13                     ` Al Viro
2022-09-10 22:35                       ` Chuck Lever III
2022-09-11  3:51                         ` Al Viro
2022-09-11 10:47                   ` Benjamin Coddington
2022-09-11 18:36                   ` Chuck Lever III
2022-09-11 19:39                     ` Al Viro [this message]
2022-09-12 18:45                       ` Benjamin Coddington
2022-09-13  2:43                         ` [pull request] vfs.git: fix for nfsd regression caused by iov_iter stuff Al Viro
2022-09-13 13:16                           ` pr-tracker-bot
2022-09-03  4:25     ` Is this nfsd kernel oops known? NeilBrown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yx45clPaZODzYV+z@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=aglo@umich.edu \
    --cc=bcodding@redhat.com \
    --cc=chuck.lever@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox