From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever <cel@kernel.org>, linux-nfs@vger.kernel.org
Cc: Maxim Levitsky <mlevitsk@redhat.com>,
Chuck Lever <chuck.lever@oracle.com>
Subject: Re: [PATCH v2] SUNRPC: Fix the recent bv_offset fix
Date: Tue, 29 Aug 2023 17:23:04 -0400 [thread overview]
Message-ID: <65f510cdc17fa3e0d2fce9362dd47ddb8b3d8d9c.camel@kernel.org> (raw)
In-Reply-To: <169322894408.11188.14223137341540815863.stgit@bazille.1015granger.net>
On Mon, 2023-08-28 at 09:23 -0400, Chuck Lever wrote:
> From: Chuck Lever <chuck.lever@oracle.com>
>
> Jeff confirmed his original fix addressed his pynfs test failure,
> but this same bug also impacted qemu: accessing qcow2 virtual disks
> using direct I/O was failing. Jeff's fix missed that you have to
> shorten the bio_vec element by the same amount as you increased
> the page offset.
>
> Reported-by: Maxim Levitsky <mlevitsk@redhat.com>
> Fixes: c96e2a695e00 ("sunrpc: set the bv_offset of first bvec in svc_tcp_sendmsg")
> Tested-by: Maxim Levitsky <mlevitsk@redhat.com>
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
> net/sunrpc/svcsock.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> v2:
> - Correct Maxim's email addresses.
>
> diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
> index 2eb8df44f894..589020ed909d 100644
> --- a/net/sunrpc/svcsock.c
> +++ b/net/sunrpc/svcsock.c
> @@ -1244,8 +1244,10 @@ static int svc_tcp_sendmsg(struct socket *sock, struct xdr_buf *xdr,
> if (ret != head->iov_len)
> goto out;
>
> - if (xdr_buf_pagecount(xdr))
> + if (xdr_buf_pagecount(xdr)) {
> xdr->bvec[0].bv_offset = offset_in_page(xdr->page_base);
> + xdr->bvec[0].bv_len -= offset_in_page(xdr->page_base);
> + }
>
> msg.msg_flags = MSG_SPLICE_PAGES;
> iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, xdr->bvec,
>
>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
prev parent reply other threads:[~2023-08-29 21:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-28 13:23 [PATCH v2] SUNRPC: Fix the recent bv_offset fix Chuck Lever
2023-08-29 21:23 ` Jeff Layton [this message]
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=65f510cdc17fa3e0d2fce9362dd47ddb8b3d8d9c.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=cel@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=mlevitsk@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox