From: Julien Desfossez Date: Fri, 14 Feb 2014 19:25:26 +0000 (-0500) Subject: Fix: race with index file creation X-Git-Tag: v2.5.0-rc1~171 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1d6448a074accdc6cb32e2f724f9768b006a6d67;p=lttng-tools.git Fix: race with index file creation Only the data thread should create the index file since it is responsible of filling the FD field of the index struct in memory. When the control thread is ready to write the index, the FD is already set. Signed-off-by: Julien Desfossez Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index b76d07880..f6b23eb92 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -1966,17 +1966,6 @@ int relay_recv_index(struct lttcomm_relayd_hdr *recv_hdr, /* Do we have a writable ready index to write on disk. */ if (wr_index) { - /* Starting at 2.4, create the index file if none available. */ - if (conn->minor >= 4 && stream->index_fd < 0) { - ret = index_create_file(stream->path_name, stream->channel_name, - relayd_uid, relayd_gid, stream->tracefile_size, - stream->tracefile_count_current); - if (ret < 0) { - goto end_rcu_unlock; - } - stream->index_fd = ret; - } - ret = relay_index_write(wr_index->fd, wr_index); if (ret < 0) { goto end_rcu_unlock;