Fix: mmap write() for large subbuffers and handle EINTR (v2)
With large subbuffer (packet) size, if write() returns before copying the
entire packet for mmap buffers, the consumerd restarts the write
infinitely, which is not good at all.
This affects both lttng-ust (in default mmap mode) and lttng-kernel (but
only for mmap buffers, which is not the default).
This issue would show up with large subbuffer size.
We need to handle this case, as well as EINTR errors (which need to restart
write).
Also fixing the return value of mmap read functions, which were returning
the amount of data written by the last invocation of write() rather than
the total number of bytes written. splice use had the same issue.
Also now consider a write() that returns more bytes than requested as an
error.
Moreover, assigning error = ret after failed splice and write was a
mistake: error is holding the actual error value. ret just holds -1.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
This page took 0.027309 seconds and 4 git commands to generate.