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:20:41 +0000 (09:20 -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 e774532107e591ad5b6f431086965b85647c5249..2612063e2ab68b115113f6c8081b35708714f38d 100644 (file)
@@ -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;
        }
This page took 0.027526 seconds and 4 git commands to generate.