Fix: missing rcu_read_lock when calling trace_ust_find_agent()
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 13 Nov 2014 21:23:04 +0000 (16:23 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 13 Nov 2014 21:28:23 +0000 (16:28 -0500)
Added a comment to note that this function is assumed to be
called with the rcu_read_lock held.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/agent-thread.c
src/bin/lttng-sessiond/trace-ust.c

index 1caf748432a4ec1918cab71a87b4788e02da1e47..2c018e9c686050263651f9c7ec54552ef45b536c 100644 (file)
@@ -60,10 +60,12 @@ static void update_agent_app(struct agent_app *app)
                if (session->ust_session) {
                        struct agent *agt;
 
+                       rcu_read_lock();
                        agt = trace_ust_find_agent(session->ust_session, app->domain);
                        if (agt) {
                                agent_update(agt, app->sock->fd);
                        }
+                       rcu_read_unlock();
                }
                session_unlock(session);
        }
index 1f6fd52736abe4f8abde125fdc092601d491ec46..339148ae9cdb8fa8da1121bd39d335b5f2b89141 100644 (file)
@@ -202,6 +202,9 @@ error:
 /*
  * Lookup an agent in the session agents hash table by domain type and return
  * the object if found else NULL.
+ *
+ * RCU read side lock must be acquired before calling and only released
+ * once the agent is no longer in scope or being used.
  */
 struct agent *trace_ust_find_agent(struct ltt_ust_session *session,
                enum lttng_domain_type domain_type)
This page took 0.037106 seconds and 4 git commands to generate.