From 6d16b11022772a21cfae158dfbe8c4f88bb78b2f Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 13 Apr 2026 18:32:25 +0200 Subject: [PATCH] BUG/MINOR: haterm: preserve the pipe size margin for splicing Originally in httpterm we used to allocate 5/4 of the size of a pipe to permit to use vmsplice because there's some fragmentation or overhead internally that requires to use a bit of margin. While this was initially applied to haterm as well, it was accidentally lost with commit fb82dece47 ("BUG/MEDIUM: haterm: Properly initialize the splicing support for haterm"), resulting in errors about vmsplice() whenever tune.pipesize is set. Let's enforce the ratio again. No backport is needed. --- src/haterm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/haterm.c b/src/haterm.c index ef6c8ca40..dfe9e5ae0 100644 --- a/src/haterm.c +++ b/src/haterm.c @@ -1225,7 +1225,7 @@ static void hstream_init_splicing(void) int total, ret; #ifdef F_SETPIPE_SZ - fcntl(master_pipe->cons, F_SETPIPE_SZ, pipesize); + fcntl(master_pipe->cons, F_SETPIPE_SZ, pipesize * 5 / 4); #endif total = ret = 0; do { @@ -1238,7 +1238,7 @@ static void hstream_init_splicing(void) if (master_pipesize < pipesize) { if (master_pipesize < 60*1024) { /* Older kernels were limited to around 60-61 kB */ - ha_warning("Failed to vmsplice haterm mastre pipe after %lu bytes, splicing disabled for haterm\n", master_pipesize); + ha_warning("Failed to vmsplice haterm master pipe after %lu bytes, splicing disabled for haterm\n", master_pipesize); put_pipe(master_pipe); master_pipe = NULL; master_pipesize = 0;