Add rcu_read_ongoing() assertions around process_client_msg
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 7 Sep 2015 14:36:08 +0000 (10:36 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 8 Sep 2015 14:01:07 +0000 (10:01 -0400)
process_client_msg ensures that RCU read-side lock should not be held
when calling it. Validate this using rcu_read_ongoing() at the entry and
exit points of this function. This allows us to catch unbalanced RCU
read-side lock within commands quickly.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/main.c

index 9519eb397d789c89350085bbb5bcb550077cf94f..6454449bdcb24cbb1f9c783fd021fe1f75d144c7 100644 (file)
@@ -2962,6 +2962,8 @@ static int process_client_msg(struct command_ctx *cmd_ctx, int sock,
 
        DBG("Processing client command %d", cmd_ctx->lsm->cmd_type);
 
+       assert(!rcu_read_ongoing());
+
        *sock_error = 0;
 
        switch (cmd_ctx->lsm->cmd_type) {
@@ -4021,6 +4023,7 @@ setup_error:
                session_unlock_list();
        }
 init_setup_error:
+       assert(!rcu_read_ongoing());
        return ret;
 }
 
This page took 0.029083 seconds and 4 git commands to generate.