Fix: add missing rcu read lock across RCU HT iteration
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 2 Mar 2012 21:56:13 +0000 (16:56 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 2 Mar 2012 21:56:13 +0000 (16:56 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/common/consumer.c

index d7b319452a87088eab5d6cd648fd7515e5b387f5..3fcb528d1c0ca87899d6d6142d57829c84cacee4 100644 (file)
@@ -500,6 +500,7 @@ int consumer_update_poll_array(
        struct lttng_consumer_stream *stream;
 
        DBG("Updating poll fd array");
+       rcu_read_lock();
        cds_lfht_for_each_entry(consumer_data.stream_ht->ht, &iter.iter, stream,
                        node.node) {
                if (stream->state != LTTNG_CONSUMER_ACTIVE_STREAM) {
@@ -511,6 +512,7 @@ int consumer_update_poll_array(
                local_stream[i] = stream;
                i++;
        }
+       rcu_read_unlock();
 
        /*
         * Insert the consumer_poll_pipe at the end of the array and don't
This page took 0.03617 seconds and 4 git commands to generate.