Fix: add missing rcu read lock across RCU HT iteration
[lttng-tools.git] / 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.022561 seconds and 4 git commands to generate.