Repository navigation
Commit 229fae3
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: 16e0c35 ("libbpf: Load global data maps lazily on legacy kernels")
Signed-off-by: Shuyi Cheng <chengshuyi@linux.alibaba.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>1 parent b69c5c0 commit 229fae3
1 file changed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
| 434 | + | |
434 | 435 | | |
435 | 436 | | |
436 | 437 | | |
| |||
5087 | 5088 | | |
5088 | 5089 | | |
5089 | 5090 | | |
5090 | | - | |
| 5091 | + | |
| 5092 | + | |
5091 | 5093 | | |
| 5094 | + | |
5092 | 5095 | | |
5093 | 5096 | | |
5094 | 5097 | | |
| |||
5717 | 5720 | | |
5718 | 5721 | | |
5719 | 5722 | | |
5720 | | - | |
5721 | | - | |
| 5723 | + | |
5722 | 5724 | | |
5723 | 5725 | | |
5724 | 5726 | | |
| |||
7926 | 7928 | | |
7927 | 7929 | | |
7928 | 7930 | | |
| 7931 | + | |
| 7932 | + | |
| 7933 | + | |
7929 | 7934 | | |
7930 | 7935 | | |
7931 | 7936 | | |
| |||
0 commit comments