From: Jérémie Galarneau Date: Mon, 9 Dec 2019 19:31:33 +0000 (-0500) Subject: Fix: sessiond: RCU read lock imbalance on get trace chunk id error X-Git-Tag: v2.11.1~27 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=95b2346e7dc4f74f2bc62b65dc1eede129b17275;p=lttng-tools.git Fix: sessiond: RCU read lock imbalance on get trace chunk id error The error path when cmd_setup_relayd() fails to get the ID of a trace chunk causes the RCU read lock to be released even though it was never acquired. Signed-off-by: Jérémie Galarneau Change-Id: I86aeb99e6cd6ba11634283ab7456a3760a0a6b0d --- diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 7c9477df9..e067cb835 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -1185,6 +1185,7 @@ int cmd_setup_relayd(struct ltt_session *session) DBG("Setting relayd for session %s", session->name); + rcu_read_lock(); if (session->current_trace_chunk) { enum lttng_trace_chunk_status status = lttng_trace_chunk_get_id( session->current_trace_chunk, ¤t_chunk_id.value); @@ -1198,8 +1199,6 @@ int cmd_setup_relayd(struct ltt_session *session) } } - rcu_read_lock(); - if (usess && usess->consumer && usess->consumer->type == CONSUMER_DST_NET && usess->consumer->enabled) { /* For each consumer socket, send relayd sockets */