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.10.3~14 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=14c6c4418bf7c18227236e2a87b84ee7a5c3a838;p=lttng-tools.git 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;