From 3a082c4ecb4b50d44aff21a1390826cd3a3d077e Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Tue, 6 Aug 2024 13:43:44 +0200 Subject: [PATCH] tcp_splice: Fix side in OUT_WAIT flag setting If the "from" (input) side for a given transfer is 0, and we can't complete the write right away, what we need to be waiting for is for output readiness on side 1, not 0, and the other way around as well. This causes random transfer failures for local TCP connections, depending if we ever need to wait for output readiness. Reported-by: Paul Holzinger Link: https://github.com/containers/podman/issues/23517 Signed-off-by: Stefano Brivio Tested-by: Paul Holzinger --- tcp_splice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcp_splice.c b/tcp_splice.c index 473562b..483e45d 100644 --- a/tcp_splice.c +++ b/tcp_splice.c @@ -577,7 +577,7 @@ eintr: if (conn->read[fromsidei] == conn->written[fromsidei]) break; - conn_event(c, conn, OUT_WAIT(fromsidei)); + conn_event(c, conn, OUT_WAIT(!fromsidei)); break; }