From 3d7708ff51bfae7a01b7062d1f2567b2854ec374 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 3 Dec 2019 04:59:10 -0500 Subject: [PATCH] Fix: relayd: missing metadata stream causes all traces to be skipped MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Commit 123ed7c22 intends for a trace that doesn't have a metadata stream to be skipped when creating viewer streams. However, the loop over ctf_traces should be "continued" rather then "broken" from when this situation arises. Otherwise, all ctf_traces of the session are skipped, which is not the intention here. Moreover, a reference to the current ctf_trace is leaked when the break (now continue) occurs. Signed-off-by: Jérémie Galarneau Change-Id: Ic630521c6f050c77a78f2c1e20c5741a6b3a66a1 --- src/bin/lttng-relayd/live.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/lttng-relayd/live.c b/src/bin/lttng-relayd/live.c index 6c1dbcd36..f00f07db1 100644 --- a/src/bin/lttng-relayd/live.c +++ b/src/bin/lttng-relayd/live.c @@ -338,7 +338,8 @@ static int make_viewer_streams(struct relay_session *session, */ if (!trace_has_metadata_stream && !ctf_trace->metadata_stream_sent_to_viewer) { - break; + ctf_trace_put(ctf_trace); + continue; } cds_list_for_each_entry_rcu(stream, &ctf_trace->stream_list, stream_node) { -- 2.34.1