Fix: ring buffer: get_subbuf() checks should be performed on "consumed" parameter
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 3 Jul 2013 22:35:10 +0000 (18:35 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 3 Jul 2013 22:36:09 +0000 (18:36 -0400)
This triggers lots of false-positive -EAGAIN errors in flight recorder
snapshots.

Reported-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lib/ringbuffer/ring_buffer_frontend.c

index e622035c04b87eacc0ad14aa08e862c98bd341c6..d8324bb30dd75976e02ee982bbbf145792ee9ebd 100644 (file)
@@ -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;
 
This page took 0.026737 seconds and 4 git commands to generate.