From: Mathieu Desnoyers Date: Wed, 3 Jul 2013 22:35:10 +0000 (-0400) Subject: Fix: ring buffer: get_subbuf() checks should be performed on "consumed" parameter X-Git-Tag: v2.1.3~1 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=e6f88d670dcb3bdb431f3c79092895873ec52e79;p=lttng-modules.git Fix: ring buffer: get_subbuf() checks should be performed on "consumed" parameter This triggers lots of false-positive -EAGAIN errors in flight recorder snapshots. Reported-by: Julien Desfossez Signed-off-by: Mathieu Desnoyers --- diff --git a/lib/ringbuffer/ring_buffer_frontend.c b/lib/ringbuffer/ring_buffer_frontend.c index e622035c..d8324bb3 100644 --- a/lib/ringbuffer/ring_buffer_frontend.c +++ b/lib/ringbuffer/ring_buffer_frontend.c @@ -1015,7 +1015,7 @@ retry: */ if (((commit_count - chan->backend.subbuf_size) & chan->commit_count_mask) - - (buf_trunc(consumed_cur, chan) + - (buf_trunc(consumed, chan) >> chan->backend.num_subbuf_order) != 0) goto nodata; @@ -1024,7 +1024,7 @@ retry: * Check that we are not about to read the same subbuffer in * which the writer head is. */ - if (subbuf_trunc(write_offset, chan) - subbuf_trunc(consumed_cur, chan) + if (subbuf_trunc(write_offset, chan) - subbuf_trunc(consumed, chan) == 0) goto nodata;