Fix: set_relayd_for_snapshot does not acquire the consumer socket lock
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 14 Feb 2018 21:05:18 +0000 (16:05 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 15 Feb 2018 20:14:03 +0000 (15:14 -0500)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/cmd.c

index 1adb27f26b4b508925ff70b3c97cbf85ba093240..731040a3c6c9e157ec2fe9f9b91268ae4fdbccf6 100644 (file)
@@ -3610,10 +3610,12 @@ static int set_relayd_for_snapshot(struct consumer_output *consumer,
        rcu_read_lock();
        cds_lfht_for_each_entry(snap_output->consumer->socks->ht, &iter.iter,
                        socket, node.node) {
+               pthread_mutex_lock(socket->lock);
                ret = send_consumer_relayd_sockets(0, session->id,
                                snap_output->consumer, socket,
                                session->name, session->hostname,
                                session->live_timer);
+               pthread_mutex_unlock(socket->lock);
                if (ret != LTTNG_OK) {
                        rcu_read_unlock();
                        goto error;
This page took 0.027808 seconds and 4 git commands to generate.