Use ust_lock during sock_info operations for atomicity against fork
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Mon, 5 Feb 2018 22:58:19 +0000 (17:58 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 6 Feb 2018 13:23:48 +0000 (08:23 -0500)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/lttng-ust-comm.c

index 32ba3c1d49e2ba7bbec27ffb2f0d3f502d168653..0cf5ecd9687536be5fc7794c4bfeb28ed135a11f 100644 (file)
@@ -1396,6 +1396,10 @@ restart:
                prev_connect_failed = 0;
        }
 
+       if (ust_lock()) {
+               goto quit;
+       }
+
        if (sock_info->socket != -1) {
                /* FD tracker is updated by ustcomm_close_unix_sock() */
                ret = ustcomm_close_unix_sock(sock_info->socket);
@@ -1415,9 +1419,6 @@ restart:
                sock_info->notify_socket = -1;
        }
 
-       if (ust_lock()) {
-               goto quit;
-       }
 
        /*
         * Register. We need to perform both connect and sending
This page took 0.025981 seconds and 4 git commands to generate.