[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y35YbwZP7w4xEf4Z@ZenIV>
Date: Wed, 23 Nov 2022 17:29:19 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: Anders Blomdell <anders.blomdell@...trol.lth.se>
Cc: linux-nfs@...r.kernel.org, Chuck Lever <chuck.lever@...cle.com>,
Jeff Layton <jlayton@...nel.org>, linux-kernel@...r.kernel.org,
Anna Schumaker <anna@...nel.org>,
Trond Myklebust <trond.myklebust@...merspace.com>,
Benjamin Coddington <bcodding@...hat.com>
Subject: Re: Kernel 6.0.5 breaks virtual machines that boot from nfs mounted
qcow2 images
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...
Powered by blists - more mailing lists