From: Julien Desfossez Date: Fri, 27 Nov 2015 17:12:44 +0000 (-0500) Subject: Fix: close indexes when rotating the trace files in splice mode X-Git-Tag: v2.8.0-rc1~207 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=3c1150e16dc06456439ce4ae45da50b44a9c3b7c;hp=9589be740bb4dc78669f5b73236082bf4682f511 Fix: close indexes when rotating the trace files in splice mode The consumer needs to close the old index file when doing a file rotation before opening a new one. The relay does not have this problem (handled with refcounts). Signed-off-by: Julien Desfossez Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index 2897fb855..f0bacfb8f 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -1779,6 +1779,12 @@ ssize_t lttng_consumer_on_read_subbuffer_splice( outfd = stream->out_fd; if (stream->index_fd >= 0) { + ret = close(stream->index_fd); + if (ret < 0) { + PERROR("Closing index"); + goto end; + } + stream->index_fd = -1; ret = index_create_file(stream->chan->pathname, stream->name, stream->uid, stream->gid, stream->chan->tracefile_size,