From: Mathieu Desnoyers Date: Tue, 16 Aug 2011 13:18:36 +0000 (-0400) Subject: kconsumerd: fix infinite loop in splice handling of subbuf larger than 4k X-Git-Tag: v2.0-pre12~20 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=751667bdf3d5d79ca89a6dcf1a2d8155c8cfbc3c;p=lttng-tools.git kconsumerd: fix infinite loop in splice handling of subbuf larger than 4k Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttngkconsumerd/lttngkconsumerd.c b/liblttngkconsumerd/lttngkconsumerd.c index ba26026c4..b6a533c17 100644 --- a/liblttngkconsumerd/lttngkconsumerd.c +++ b/liblttngkconsumerd/lttngkconsumerd.c @@ -474,9 +474,7 @@ int lttng_kconsumerd_on_read_subbuffer_splice( perror("Error in file splice"); goto splice_error; } - if (ret >= len) { - len = 0; - } + len -= ret; /* This won't block, but will start writeout asynchronously */ sync_file_range(outfd, kconsumerd_fd->out_fd_offset, ret, SYNC_FILE_RANGE_WRITE);