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:32:56 +0000 (16:32 -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 b76d078800847cfc8b18db032736c4e1a535ca7d..f6b23eb928a9137ae5eb939dc8c9efa4a892c81b 100644 (file)
@@ -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;
This page took 0.033728 seconds and 4 git commands to generate.