🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by Avi Weiss Sat, 31 Oct 2026 09:59
[PATCH] splice, net: avoid MSG_MORE when the bvec array fills
#9119
Author: Avi Weiss
Date: Sat, 31 Oct 2026 09:59
33 lines
11737 bytes
splice_to_socket() leaves tail at the last included pipe buffer when
its 16-entry bvec array fills. If the requested length exceeds the
available pipe data, pipe_occupancy() counts that buffer again and sets
MSG_MORE even though the pipe is empty. Small TCP transfers can then be
delayed until the cork timeout expires.

Advance tail before checking the array limit so the occupancy test
counts only pipe buffers that have not been included in the send.

Fixes: ca2d49f77ce4 ("splice, net: Fix splice_to_socket() to handle pipe bufs larger than a page")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
---
 fs/splice.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/splice.c b/fs/splice.c
index bc243ab8dc43..7c67e0375ae2 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -863,9 +863,9 @@ ssize_t splice_to_socket(struct pipe_inode_info *pipe, struct file *out,
 
 			bvec_set_page(&bvec[bc++], buf->page, seg, buf->offset);
 			remain -= seg;
+			tail++;
 			if (remain == 0 || bc >= ARRAY_SIZE(bvec))
 				break;
-			tail++;
 		}
 
 		if (!bc)
-- 
2.43.0
Re: [PATCH] splice, net: avoid MSG_MORE when the bvec array fills
#12207
Author: Christian Brauner
Date: Fri, 06 Nov 2026 14:04
30 lines
8961 bytes
On Sat, 31 Oct 2026 11:59:23 +0200, Avi Weiss wrote:
> splice_to_socket() leaves tail at the last included pipe buffer when
> its 16-entry bvec array fills. If the requested length exceeds the
> available pipe data, pipe_occupancy() counts that buffer again and sets
> MSG_MORE even though the pipe is empty. Small TCP transfers can then be
> delayed until the cork timeout expires.
> 
> Advance tail before checking the array limit so the occupancy test
> counts only pipe buffers that have not been included in the send.
> 
> [...]

Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes

[1/1] splice, net: avoid MSG_MORE when the bvec array fills
      https://git.kernel.org/vfs/vfs/c/8eaa35c6c29a
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads