Fix: race with index file creation
authorJulien Desfossez <jdesfossez@efficios.com>
Fri, 14 Feb 2014 19:25:26 +0000 (14:25 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 14 Feb 2014 21:54:15 +0000 (16:54 -0500)
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 <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-relayd/main.c

index 1cbd12a65ea5a955a1d1ee6514bcaeccdc1cca84..1ced139016cdf83d04ea122fb40f5009e187520b 100644 (file)
@@ -1830,17 +1830,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;
This page took 0.02743 seconds and 4 git commands to generate.