Fix: event notifier: adapt read iterator state to poll expectations
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 4 Feb 2020 20:46:41 +0000 (15:46 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 18 Nov 2020 18:12:06 +0000 (13:12 -0500)
When completing to read a subbuffer, ensure that the state of the
iterator is moved forward so the "put_subbuf" is performed before
returning to the user, so poll() will not return POLLIN when there
is actually no data available to read.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ia94b5dcb0c72d8548325b1004f214044f50fd191

src/lttng-abi.c

index 09e437884c8e54971dad9597d6f517cb8cf660fc..c62e295e5fdea2f9ebb320fd8340cfb51e52314e 100644 (file)
@@ -909,11 +909,14 @@ skip_get_next:
                }
                read_count += copy_len;
        }
-       return read_count;
+       goto put_record;
 
 nodata:
        *ppos = 0;
        chan->iter.len_left = 0;
+
+put_record:
+       lib_ring_buffer_put_current_record(buf);
        return read_count;
 }
 
This page took 0.027854 seconds and 4 git commands to generate.