Fix: HT must not be destroyed with a rcu_read_lock held
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 15 Nov 2014 04:38:36 +0000 (23:38 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 16 Nov 2014 14:56:41 +0000 (09:56 -0500)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/session.c

index a9907c45d9c264a424b59646a08c47a9ffd033d3..984073c62b6cc29ed6c300d1c7446b1273ce0585 100644 (file)
@@ -153,6 +153,9 @@ void session_try_destroy(struct lttng_ht *ht, struct relay_session *session)
 
 /*
  * Destroy a session object.
+ *
+ * This function must *NOT* be called with an RCU read lock held since
+ * the session's ctf_traces_ht is destroyed.
  */
 void session_destroy(struct relay_session *session)
 {
@@ -173,8 +176,8 @@ void session_destroy(struct relay_session *session)
                ctf_trace_delete(session->ctf_traces_ht, ctf_trace);
                ctf_trace_destroy(ctf_trace);
        }
-       lttng_ht_destroy(session->ctf_traces_ht);
        rcu_read_unlock();
+       lttng_ht_destroy(session->ctf_traces_ht);
 
        call_rcu(&session->rcu_node, rcu_destroy_session);
 }
This page took 0.02599 seconds and 4 git commands to generate.