Skip to content
Commit 229fae38 authored by Shuyi Cheng's avatar Shuyi Cheng Committed by Andrii Nakryiko
Browse files

libbpf: Add "bool skipped" to struct bpf_map

Fix error: "failed to pin map: Bad file descriptor, path:
/sys/fs/bpf/_rodata_str1_1."

In the old kernel, the global data map will not be created, see [0]. So
we should skip the pinning of the global data map to avoid
bpf_object__pin_maps returning error. Therefore, when the map is not
created, we mark “map->skipped" as true and then check during relocation
and during pinning.

Fixes: 16e0c35c

 ("libbpf: Load global data maps lazily on legacy kernels")
Signed-off-by: default avatarShuyi Cheng <chengshuyi@linux.alibaba.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
parent b69c5c07
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment