From: Jérémie Galarneau Date: Tue, 18 Nov 2014 19:15:07 +0000 (-0500) Subject: Fix: Missing rcu_read_locks in cmd_list_domains() X-Git-Tag: v2.6.0-rc4~44 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f376cc6aa47ca9f6069d8d471820706bb63c5168;p=lttng-tools.git Fix: Missing rcu_read_locks in cmd_list_domains() Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index b200c9521..b0bd9837f 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -2402,12 +2402,14 @@ ssize_t cmd_list_domains(struct ltt_session *session, DBG3("Listing domains found UST global domain"); nb_dom++; + rcu_read_lock(); cds_lfht_for_each_entry(session->ust_session->agents->ht, &iter.iter, agt, node.node) { if (agt->being_used) { nb_dom++; } } + rcu_read_unlock(); } *domains = zmalloc(nb_dom * sizeof(struct lttng_domain)); @@ -2426,6 +2428,7 @@ ssize_t cmd_list_domains(struct ltt_session *session, (*domains)[index].buf_type = session->ust_session->buffer_type; index++; + rcu_read_lock(); cds_lfht_for_each_entry(session->ust_session->agents->ht, &iter.iter, agt, node.node) { if (agt->being_used) { @@ -2434,6 +2437,7 @@ ssize_t cmd_list_domains(struct ltt_session *session, index++; } } + rcu_read_unlock(); } return nb_dom;