All of lore.kernel.org
 help / color / mirror / Atom feed
From: "A. Duvnjak" <avian@extremenerds.net>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH v1] SUNRPC: Fix NFS READs that start at non-page-aligned offsets
Date: Mon, 1 Feb 2021 17:14:53 +1100	[thread overview]
Message-ID: <A1D67DE8-6DA9-432C-B91D-A2AD6B148656@extremenerds.net> (raw)
In-Reply-To: <161214078155.1093.2334504504623797564.stgit@klimt.1015granger.net>

I tried this patch on 5.10.12 (which would normally produce streaming errors).  So far it works well.   Have tried it in the three situations that would previously cause issues -  Kodi on Windows,  Kodi on Mac, and the Windows 10 NFS client with VLC.  All check out fine.


> On 1 Feb 2021, at 11:53 am, Chuck Lever <chuck.lever@oracle.com> wrote:
> 
> Anj Duvnjak reports that the Kodi.tv NFS client is not able to read
> video files from a v5.10.11 Linux NFS server.
> 
> The new sendpage-based TCP sendto logic was not attentive to non-
> zero page_base values. nfsd_splice_read() sets that field when a
> READ payload starts in the middle of a page.
> 
> The Linux NFS client rarely emits an NFS READ that is not page-
> aligned. All of my testing so far has been with Linux clients, so I
> missed this one.
> 
> Reported-by: A. Duvnjak <avian@extremenerds.net>
> BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=211471
> Fixes: 4a85a6a3320b ("SUNRPC: Handle TCP socket sends with kernel_sendpage() again")
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
> net/sunrpc/svcsock.c |    7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
> index c9766d07eb81..5a809c64dc7b 100644
> --- a/net/sunrpc/svcsock.c
> +++ b/net/sunrpc/svcsock.c
> @@ -1113,14 +1113,15 @@ static int svc_tcp_sendmsg(struct socket *sock, struct msghdr *msg,
> 		unsigned int offset, len, remaining;
> 		struct bio_vec *bvec;
> 
> -		bvec = xdr->bvec;
> -		offset = xdr->page_base;
> +		bvec = xdr->bvec + (xdr->page_base >> PAGE_SHIFT);
> +		offset = offset_in_page(xdr->page_base);
> 		remaining = xdr->page_len;
> 		flags = MSG_MORE | MSG_SENDPAGE_NOTLAST;
> 		while (remaining > 0) {
> 			if (remaining <= PAGE_SIZE && tail->iov_len == 0)
> 				flags = 0;
> -			len = min(remaining, bvec->bv_len);
> +
> +			len = min(remaining, bvec->bv_len - offset);
> 			ret = kernel_sendpage(sock, bvec->bv_page,
> 					      bvec->bv_offset + offset,
> 					      len, flags);
> 
> 


      reply	other threads:[~2021-02-01  6:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01  0:53 [PATCH v1] SUNRPC: Fix NFS READs that start at non-page-aligned offsets Chuck Lever
2021-02-01  6:14 ` A. Duvnjak [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=A1D67DE8-6DA9-432C-B91D-A2AD6B148656@extremenerds.net \
    --to=avian@extremenerds.net \
    --cc=chuck.lever@oracle.com \
    --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 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.