Fix: Missing rcu_read_locks in cmd_list_domains()
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 18 Nov 2014 19:15:07 +0000 (14:15 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 21 Nov 2014 07:35:55 +0000 (02:35 -0500)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/cmd.c

index b200c95218600e5ab1613711ada5adbd88062460..b0bd9837ff9a62846f7a4dbf7dabe130f2d6082b 100644 (file)
@@ -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;
This page took 0.03262 seconds and 4 git commands to generate.