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:25:27 +0000 (08:25 -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 e92bb870d4d58abcd2874ab80e9e7e56525a591d..6c11288c8d2f2d571bbacd86163122da3e8a703a 100644 (file)
@@ -1382,6 +1382,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);
@@ -1401,9 +1405,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.02744 seconds and 4 git commands to generate.