diff options
| author | Ludovic L'Hours <[email protected]> | 2023-01-08 18:20:18 +0000 |
|---|---|---|
| committer | Martin KaFai Lau <[email protected]> | 2023-01-11 01:52:22 +0000 |
| commit | 6920b08661e3ad829206078b5c9879b24aea8dfc (patch) | |
| tree | 189a9d54bca0e8e9ca3adfcfbdfa2110c1b9198c /tools/lib/bpf/libbpf.c | |
| parent | bpftool: fix output for skipping kernel config check (diff) | |
| download | kernel-6920b08661e3ad829206078b5c9879b24aea8dfc.tar.gz kernel-6920b08661e3ad829206078b5c9879b24aea8dfc.zip | |
libbpf: Fix map creation flags sanitization
As BPF_F_MMAPABLE flag is now conditionnaly set (by map_is_mmapable),
it should not be toggled but disabled if not supported by kernel.
Fixes: 4fcac46c7e10 ("libbpf: only add BPF_F_MMAPABLE flag for data maps with global vars")
Signed-off-by: Ludovic L'Hours <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Martin KaFai Lau <[email protected]>
Diffstat (limited to 'tools/lib/bpf/libbpf.c')
| -rw-r--r-- | tools/lib/bpf/libbpf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index a5c67a3c93c5..f8dfee32c2bc 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -7355,7 +7355,7 @@ static int bpf_object__sanitize_maps(struct bpf_object *obj) if (!bpf_map__is_internal(m)) continue; if (!kernel_supports(obj, FEAT_ARRAY_MMAP)) - m->def.map_flags ^= BPF_F_MMAPABLE; + m->def.map_flags &= ~BPF_F_MMAPABLE; } return 0; |
