diff options
author | Toke Høiland-Jørgensen <toke@redhat.com> | 2019-11-09 21:37:27 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-11-11 04:26:30 +0100 |
commit | ec6d5f47bfe36f46aa0de707e5beb2f58d96b76d (patch) | |
tree | f9bb7944a22d5e60f867ba88a18fa721d9562e92 /tools/lib/bpf/btf_dump.c | |
parent | samples: bpf: update map definition to new syntax BTF-defined map (diff) | |
download | linux-ec6d5f47bfe36f46aa0de707e5beb2f58d96b76d.tar.xz linux-ec6d5f47bfe36f46aa0de707e5beb2f58d96b76d.zip |
libbpf: Unpin auto-pinned maps if loading fails
Since the automatic map-pinning happens during load, it will leave pinned
maps around if the load fails at a later stage. Fix this by unpinning any
pinned maps on cleanup. To avoid unpinning pinned maps that were reused
rather than newly pinned, add a new boolean property on struct bpf_map to
keep track of whether that map was reused or not; and only unpin those maps
that were not reused.
Fixes: 57a00f41644f ("libbpf: Add auto-pinning of maps when loading BPF objects")
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/157333184731.88376.9992935027056165873.stgit@toke.dk
Diffstat (limited to 'tools/lib/bpf/btf_dump.c')
0 files changed, 0 insertions, 0 deletions