From: Mathieu Desnoyers Date: Wed, 26 Jun 2013 23:42:52 +0000 (-0400) Subject: print warning and return -EBUSY on double get_subbuf() X-Git-Tag: v2.3.0-rc1~20 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=8202b8a0cca4c5b271c8ff729aa3b572eece6edf;p=lttng-modules.git print warning and return -EBUSY on double get_subbuf() Each get_subbuf() should be paired with a put_subbuf(). Signed-off-by: Mathieu Desnoyers --- diff --git a/lib/ringbuffer/ring_buffer_frontend.c b/lib/ringbuffer/ring_buffer_frontend.c index bff920d1..84341adc 100644 --- a/lib/ringbuffer/ring_buffer_frontend.c +++ b/lib/ringbuffer/ring_buffer_frontend.c @@ -927,6 +927,13 @@ int lib_ring_buffer_get_subbuf(struct lib_ring_buffer *buf, int ret; int finalized; + if (buf->get_subbuf) { + /* + * Reader is trying to get a subbuffer twice. + */ + CHAN_WARN_ON(chan, 1); + return -EBUSY; + } retry: finalized = ACCESS_ONCE(buf->finalized); /*