From: Julien Desfossez Date: Tue, 13 Aug 2013 21:40:28 +0000 (-0400) Subject: Fix: reset out_fd_offset when we rotate the trace file X-Git-Tag: v2.2.4~24 X-Git-Url: https://git.liburcu.org/?a=commitdiff_plain;h=e32c867f84a5abc518ee47566690b1a2c1b59f5a;hp=da3d1b707e026be8fd7f4f133e729890c7dc3653;p=lttng-tools.git Fix: reset out_fd_offset when we rotate the trace file This value is only used for the sync_file_range, but it has to be set to 0 when we start to write in a new trace file, otherwise the values passed to this call are bogus. Applied to 2.3, but could probably be backported to 2.2. Acked-by: Mathieu Desnoyers Signed-off-by: Julien Desfossez Signed-off-by: David Goulet --- diff --git a/src/common/consumer.c b/src/common/consumer.c index e77453210..2612063e2 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -1464,6 +1464,8 @@ ssize_t lttng_consumer_on_read_subbuffer_mmap( outfd = stream->out_fd = ret; /* Reset current size because we just perform a rotation. */ stream->tracefile_size_current = 0; + stream->out_fd_offset = 0; + orig_offset = 0; } stream->tracefile_size_current += len; } @@ -1647,6 +1649,8 @@ ssize_t lttng_consumer_on_read_subbuffer_splice( outfd = stream->out_fd = ret; /* Reset current size because we just perform a rotation. */ stream->tracefile_size_current = 0; + stream->out_fd_offset = 0; + orig_offset = 0; } stream->tracefile_size_current += len; }