]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
libbpf: Fix bail out from 'ringbuf_process_ring()' on error
authorPedro Tammela <pctammela@gmail.com>
Thu, 25 Mar 2021 15:01:15 +0000 (12:01 -0300)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 7 May 2021 07:53:24 +0000 (09:53 +0200)
commit3bfc1295a4227b0de9556604190cfedb50cbb46d
tree69dbabbd1205b697f476a3859e5f46e1cec58e37
parente5eb2ab27d940c54476a4fa733045c83375e1ad3
libbpf: Fix bail out from 'ringbuf_process_ring()' on error

BugLink: https://bugs.launchpad.net/bugs/1926368
commit 6032ebb54c60cae24329f6aba3ce0c1ca8ad6abe upstream.

The current code bails out with negative and positive returns.
If the callback returns a positive return code, 'ring_buffer__consume()'
and 'ring_buffer__poll()' will return a spurious number of records
consumed, but mostly important will continue the processing loop.

This patch makes positive returns from the callback a no-op.

Fixes: bf99c936f947 ("libbpf: Add BPF ring buffer support")
Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210325150115.138750-1-pctammela@mojatatu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
tools/lib/bpf/ringbuf.c