Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: avoid one loop iteration in __skb_splice_bits

If *len is equal to 0 at the beginning of __splice_segment
it returns true directly. But when decreasing *len from
a positive number to 0 in __splice_segment, it returns false.
The __skb_splice_bits needs to call __splice_segment again.

Recheck *len if it changes, return true in time.
Reduce unnecessary calls to __splice_segment.

Signed-off-by: Pengtao He <hept.hept.hept@gmail.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20250819021551.8361-1-hept.hept.hept@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Pengtao He and committed by
Jakub Kicinski
8f2c72f2 c3199adb

+3 -1
+3 -1
net/core/skbuff.c
··· 3112 3112 poff += flen; 3113 3113 plen -= flen; 3114 3114 *len -= flen; 3115 - } while (*len && plen); 3115 + if (!*len) 3116 + return true; 3117 + } while (plen); 3116 3118 3117 3119 return false; 3118 3120 }