mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hughd@google.com>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	 Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	 Eric Dumazet <edumazet@google.com>,
	Hugh Dickins <hughd@google.com>,
	 netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] net: fix rc7's __skb_datagram_iter()
Date: Sun, 7 Jul 2024 20:00:04 -0700 (PDT)	[thread overview]
Message-ID: <58ad4867-6178-54bd-7e49-e35875d012f9@google.com> (raw)

X would not start in my old 32-bit partition (and the "n"-handling looks
just as wrong on 64-bit, but for whatever reason did not show up there):
"n" must be accumulated over all pages before it's added to "offset" and
compared with "copy", immediately after the skb_frag_foreach_page() loop.

Fixes: d2d30a376d9c ("net: allow skb_datagram_iter to be called from any context")
Signed-off-by: Hugh Dickins <hughd@google.com>
---
 net/core/datagram.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/core/datagram.c b/net/core/datagram.c
index e9ba4c7b449d..ea69d01156e6 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -420,6 +420,7 @@ static int __skb_datagram_iter(const struct sk_buff *skb, int offset,
 			struct page *p;
 			u8 *vaddr;
 
+			n = 0;
 			if (copy > len)
 				copy = len;
 
@@ -427,7 +428,7 @@ static int __skb_datagram_iter(const struct sk_buff *skb, int offset,
 					      skb_frag_off(frag) + offset - start,
 					      copy, p, p_off, p_len, copied) {
 				vaddr = kmap_local_page(p);
-				n = INDIRECT_CALL_1(cb, simple_copy_to_iter,
+				n += INDIRECT_CALL_1(cb, simple_copy_to_iter,
 					vaddr + p_off, p_len, data, to);
 				kunmap_local(vaddr);
 			}
-- 
2.35.3

             reply	other threads:[~2024-07-08  3:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-08  3:00 Hugh Dickins [this message]
2024-07-08  6:21 ` Sagi Grimberg
2024-07-08 14:46   ` [PATCH v2] " Hugh Dickins
2024-07-08 14:47     ` Sagi Grimberg
2024-07-10 15:36       ` [PATCH v3] " Hugh Dickins
2024-07-10 16:19         ` Paolo Abeni
2024-07-10 16:36           ` Hugh Dickins
2024-07-11 20:43         ` patchwork-bot+netdevbpf

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=58ad4867-6178-54bd-7e49-e35875d012f9@google.com \
    --to=hughd@google.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sagi@grimberg.me \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®