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.9.8~14 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=32a57e73c32665293649226ccbc8af025792f35e;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 1adb27f26..731040a3c 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -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;