From: Mathieu Desnoyers Date: Wed, 26 Jun 2013 17:55:31 +0000 (-0400) Subject: Fix: don't do 0 byte event reservation X-Git-Tag: v2.3.0-rc1~22 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=9de2c21569afcb6b983e81a2e9b1d0c2b83c98f0;p=lttng-modules.git Fix: don't do 0 byte event reservation Caused sequence of: lttng create lttng enable-event -k sched_switch lttng start lttng stop lttng start lttng stop to hang on waiting for data...... Issue appeared in commit d83004aa718065e5221d8ef4b99e4302b70b3df9 Author: Julien Desfossez Date: Thu Jun 6 16:38:48 2013 -0400 Metadata cache and multiple metadata channels Signed-off-by: Mathieu Desnoyers --- diff --git a/lttng-events.c b/lttng-events.c index faf3e1f0..27a8f864 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -563,6 +563,8 @@ int lttng_metadata_output_channel(struct lttng_channel *chan, len = stream->metadata_cache->metadata_written - stream->metadata_cache_read; + if (!len) + return 0; reserve_len = min_t(size_t, chan->ops->packet_avail_size(chan->chan), len);