All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Anders Blomdell <anders.blomdell@control.lth.se>
Cc: linux-nfs@vger.kernel.org, Chuck Lever <chuck.lever@oracle.com>,
	Jeff Layton <jlayton@kernel.org>,
	linux-kernel@vger.kernel.org, Anna Schumaker <anna@kernel.org>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	Benjamin Coddington <bcodding@redhat.com>
Subject: Re: Kernel 6.0.5 breaks virtual machines that boot from nfs mounted qcow2 images
Date: Wed, 23 Nov 2022 17:29:19 +0000	[thread overview]
Message-ID: <Y35YbwZP7w4xEf4Z@ZenIV> (raw)
In-Reply-To: <0abaa41e-79e1-3c0c-6d1b-47d4e21f2296@control.lth.se>

On Wed, Nov 23, 2022 at 11:08:42AM +0100, Anders Blomdell wrote:
> Our problems turned out to be a fallout of Al Viros's splice rework, where nfsd reads with non-zero offsets and not ending
> on a page boundary failed to remap the last page. I belive that this is a decent fix for that problem (tested on v6.1-rc6,
> 6.0.7 and 6.0.9)
> 
> ---- a/fs/nfsd/vfs.c
> +++ b/fs/nfsd/vfs.c
> @@ -873,7 +873,7 @@ nfsd_splice_actor(struct pipe_inode_info *pipe, struct pipe_buffer *buf,
>         unsigned offset = buf->offset;
>         page += offset / PAGE_SIZE;
> -       for (int i = sd->len; i > 0; i -= PAGE_SIZE)
> +       for (int i = sd->len + offset % PAGE_SIZE; i > 0; i -= PAGE_SIZE)
>                 svc_rqst_replace_page(rqstp, page++);

Hmm...  A minor nit:
	last_page = page + (offset + sd->len - 1) / PAGE_SIZE;
	for (page += offset / PAGE_SIZE; page <= last_page; page++)
		svc_rqst_replace_page(rqstp, page);
might be easier to follow.  Matter of taste, though...

  parent reply	other threads:[~2022-11-23 17:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11 19:35 Kernel 6.0.5 breaks virtual machines that boot from nfs mounted qcow2 images Anders Blomdell
2022-11-23 10:08 ` Anders Blomdell
2022-11-23 16:11   ` Chuck Lever III
2022-11-23 17:29   ` Al Viro [this message]
2022-11-23 17:49   ` Benjamin Coddington
2022-11-23 17:51     ` Chuck Lever III
2022-11-23 17:57       ` Anders Blomdell
2022-11-24  9:12         ` Anders Blomdell

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=Y35YbwZP7w4xEf4Z@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=anders.blomdell@control.lth.se \
    --cc=anna@kernel.org \
    --cc=bcodding@redhat.com \
    --cc=chuck.lever@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@hammerspace.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.