Fix: reset out_fd_offset when we rotate the trace file
authorJulien Desfossez <jdesfossez@efficios.com>
Tue, 13 Aug 2013 21:40:28 +0000 (17:40 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 15 Aug 2013 13:11:48 +0000 (09:11 -0400)
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 <mathieu.desnoyers@efficios.com>
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/consumer.c

index 221c348df055722918793e32617b6812dcfbc680..59207da2f2f99f03a27b8a014f682025b03e39f7 100644 (file)
@@ -1431,6 +1431,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;
        }
@@ -1614,6 +1616,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;
        }
This page took 0.035318 seconds and 4 git commands to generate.