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>
Tue, 18 Nov 2014 19:17:16 +0000 (14:17 -0500)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/cmd.c

index 0b97ed61a1ec54fc928b1e5a69890ede4002a162..9fc21fcaf60c3ef57156145998381e9fd487765a 100644 (file)
@@ -2415,12 +2415,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();
        }
 
        if (!nb_dom) {
@@ -2443,6 +2445,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) {
@@ -2451,6 +2454,7 @@ ssize_t cmd_list_domains(struct ltt_session *session,
                                index++;
                        }
                }
+               rcu_read_unlock();
        }
 end:
        return nb_dom;
This page took 0.028625 seconds and 4 git commands to generate.