[lttng-dev] [PATCH lttng-tools] Fix: Missing read locks on access to consumerd's channel hash table
Mathieu Desnoyers
mathieu.desnoyers at efficios.com
Mon Jul 8 11:49:56 EDT 2013
* Jérémie Galarneau (jeremie.galarneau at efficios.com) wrote:
> Signed-off-by: Jérémie Galarneau <jeremie.galarneau at efficios.com>
this had been merged into lttng-tools as:
commit c7260a81b6c99282da7c59b6124381f92c637658
Author: Jérémie Galarneau <jeremie.galarneau at efficios.com>
Date: Mon Jun 3 23:19:59 2013 -0400
Fix: Missing RCU locks on access to consumerd's channel ht
Signed-off-by: Jérémie Galarneau <jeremie.galarneau at efficios.com>
Signed-off-by: David Goulet <dgoulet at efficios.com>
For both stable-2.2 and master.
> ---
> src/common/consumer.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/src/common/consumer.c b/src/common/consumer.c
> index 3709092..5f38375 100644
> --- a/src/common/consumer.c
> +++ b/src/common/consumer.c
> @@ -2716,16 +2716,21 @@ restart:
>
> lttng_ht_node_init_u64(&chan->wait_fd_node,
> chan->wait_fd);
> + rcu_read_lock();
> lttng_ht_add_unique_u64(channel_ht,
> &chan->wait_fd_node);
> + rcu_read_unlock();
> /* Add channel to the global poll events list */
> lttng_poll_add(&events, chan->wait_fd,
> LPOLLIN | LPOLLPRI);
> break;
> case CONSUMER_CHANNEL_DEL:
> {
> + rcu_read_lock();
> chan = consumer_find_channel(key);
> +
> if (!chan) {
> + rcu_read_unlock();
> ERR("UST consumer get channel key %" PRIu64 " not found for del channel", key);
> break;
> }
> @@ -2741,6 +2746,7 @@ restart:
> if (!uatomic_sub_return(&chan->refcount, 1)) {
> consumer_del_channel(chan);
> }
> + rcu_read_unlock();
> goto restart;
> }
> case CONSUMER_CHANNEL_QUIT:
> --
> 1.8.2.3
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
More information about the lttng-dev
mailing list