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 <pholzing@redhat.com>
Link: https://github.com/containers/podman/issues/23517
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Tested-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Stefano Brivio 2024-08-06 13:43:44 +02:00
parent 031df332e9
commit 3a082c4ecb

View file

@ -577,7 +577,7 @@ eintr:
if (conn->read[fromsidei] == conn->written[fromsidei]) if (conn->read[fromsidei] == conn->written[fromsidei])
break; break;
conn_event(c, conn, OUT_WAIT(fromsidei)); conn_event(c, conn, OUT_WAIT(!fromsidei));
break; break;
} }