Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:5.10 commit in: /
Date: Tue, 09 Feb 2021 19:10:21
Message-Id: 1612897753.f2b7022ccc048d545f23b383a7716a0cf9c7304f.mpagano@gentoo
1 commit: f2b7022ccc048d545f23b383a7716a0cf9c7304f
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 9 19:09:13 2021 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 9 19:09:13 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=f2b7022c
7
8 SUNRPC: Fix NFS READs that start at non-page-aligned offsets
9
10 See https://bugs.gentoo.org/768720
11 Thanks to DaggyStyle for reporting and testing
12
13 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
14
15 0000_README | 4 ++
16 ...RPC-NFS-fix-non-page-aligned-offsets-read.patch | 53 ++++++++++++++++++++++
17 2 files changed, 57 insertions(+)
18
19 diff --git a/0000_README b/0000_README
20 index 897c945..7375e82 100644
21 --- a/0000_README
22 +++ b/0000_README
23 @@ -111,6 +111,10 @@ Patch: 2000_BT-Check-key-sizes-only-if-Secure-Simple-Pairing-enabled.patch
24 From: https://lore.kernel.org/linux-bluetooth/20190522070540.48895-1-marcel@××××××××.org/raw
25 Desc: Bluetooth: Check key sizes only when Secure Simple Pairing is enabled. See bug #686758
26
27 +Patch: 2400_SUNRPC-NFS-fix-non-page-aligned-offsets-read.patch
28 +From: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/net/sunrpc/svcsock.c?id=bad4c6eb5eaa8300e065bd4426727db5141d687d
29 +Desc: SUNRPC: Fix NFS READs that start at non-page-aligned offsets
30 +
31 Patch: 2900_tmp513-Fix-build-issue-by-selecting-CONFIG_REG.patch
32 From: https://bugs.gentoo.org/710790
33 Desc: tmp513 requies REGMAP_I2C to build. Select it by default in Kconfig. See bug #710790. Thanks to Phil Stracchino
34
35 diff --git a/2400_SUNRPC-NFS-fix-non-page-aligned-offsets-read.patch b/2400_SUNRPC-NFS-fix-non-page-aligned-offsets-read.patch
36 new file mode 100644
37 index 0000000..34d6ebb
38 --- /dev/null
39 +++ b/2400_SUNRPC-NFS-fix-non-page-aligned-offsets-read.patch
40 @@ -0,0 +1,53 @@
41 +From bad4c6eb5eaa8300e065bd4426727db5141d687d Mon Sep 17 00:00:00 2001
42 +From: Chuck Lever <chuck.lever@××××××.com>
43 +Date: Sun, 31 Jan 2021 16:16:23 -0500
44 +Subject: SUNRPC: Fix NFS READs that start at non-page-aligned offsets
45 +
46 +Anj Duvnjak reports that the Kodi.tv NFS client is not able to read
47 +video files from a v5.10.11 Linux NFS server.
48 +
49 +The new sendpage-based TCP sendto logic was not attentive to non-
50 +zero page_base values. nfsd_splice_read() sets that field when a
51 +READ payload starts in the middle of a page.
52 +
53 +The Linux NFS client rarely emits an NFS READ that is not page-
54 +aligned. All of my testing so far has been with Linux clients, so I
55 +missed this one.
56 +
57 +Reported-by: A. Duvnjak <avian@××××××××××××.net>
58 +BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=211471
59 +Fixes: 4a85a6a3320b ("SUNRPC: Handle TCP socket sends with kernel_sendpage() again")
60 +Signed-off-by: Chuck Lever <chuck.lever@××××××.com>
61 +Tested-by: A. Duvnjak <avian@××××××××××××.net>
62 +---
63 + net/sunrpc/svcsock.c | 7 ++++---
64 + 1 file changed, 4 insertions(+), 3 deletions(-)
65 +
66 +(limited to 'net/sunrpc/svcsock.c')
67 +
68 +diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
69 +index c9766d07eb81a..5a809c64dc7b9 100644
70 +--- a/net/sunrpc/svcsock.c
71 ++++ b/net/sunrpc/svcsock.c
72 +@@ -1113,14 +1113,15 @@ static int svc_tcp_sendmsg(struct socket *sock, struct msghdr *msg,
73 + unsigned int offset, len, remaining;
74 + struct bio_vec *bvec;
75 +
76 +- bvec = xdr->bvec;
77 +- offset = xdr->page_base;
78 ++ bvec = xdr->bvec + (xdr->page_base >> PAGE_SHIFT);
79 ++ offset = offset_in_page(xdr->page_base);
80 + remaining = xdr->page_len;
81 + flags = MSG_MORE | MSG_SENDPAGE_NOTLAST;
82 + while (remaining > 0) {
83 + if (remaining <= PAGE_SIZE && tail->iov_len == 0)
84 + flags = 0;
85 +- len = min(remaining, bvec->bv_len);
86 ++
87 ++ len = min(remaining, bvec->bv_len - offset);
88 + ret = kernel_sendpage(sock, bvec->bv_page,
89 + bvec->bv_offset + offset,
90 + len, flags);
91 +--
92 +cgit 1.2.3-1.el7
93 +