From: Jérémie Galarneau Date: Wed, 14 Feb 2018 21:05:18 +0000 (-0500) Subject: Fix: set_relayd_for_snapshot does not acquire the consumer socket lock X-Git-Tag: v2.11.0-rc1~399 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=ecd0f96d0a98fde1e7760a8ec80df8e792a8cbcc Fix: set_relayd_for_snapshot does not acquire the consumer socket lock Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index ffd71bbac..67b2e77f4 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -3710,10 +3710,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;