Re: [PATCH v2] libbpf: Deprecate bpf_objects_list

From: Andrii Nakryiko
Date: Wed Oct 27 2021 - 14:02:05 EST


On Tue, Oct 26, 2021 at 3:35 PM Joe Burton <jevburton.kernel@xxxxxxxxx> wrote:
>
> From: Joe Burton <jevburton@xxxxxxxxxx>
>
> Add a flag to `enum libbpf_strict_mode' to disable the global
> `bpf_objects_list', preventing race conditions when concurrent threads
> call bpf_object__open() or bpf_object__close().
>
> bpf_object__next() will return NULL if this option is set.
>
> Callers may achieve the same workflow by tracking bpf_objects in
> application code.
>
> [0] Closes: https://github.com/libbpf/libbpf/issues/293
>
> Signed-off-by: Joe Burton <jevburton@xxxxxxxxxx>
> ---

Applied to bpf-next, thanks. Please specify kernel tree next time
(i.e., [PATCH bpf-next] subject prefix)


> tools/lib/bpf/libbpf.c | 8 +++++++-
> tools/lib/bpf/libbpf.h | 3 ++-
> tools/lib/bpf/libbpf_legacy.h | 6 ++++++
> 3 files changed, 15 insertions(+), 2 deletions(-)
>

[...]