Fix pining maps after reuse map fd
Status from this message: This series was applied to bpf/bpf-next.git (refs/heads/master):
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest3 patches 1 replyApplied 3/3
- v23 patches 3 repliesSuperseded
Changes in v3 from the cover letter
for selftest: use CHECK() for bpf_object__open_file() and close map fd on error
Patches in v3 All 3 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | libbpf: close map fd if init map slots failedtools/ | +34 | 0 replies | Applied |
| 2/3 | libbpf: check if pin_path was set even map fd existtools/ | +18 | 0 replies | Applied |
| 3/3 | selftest/bpf: test pinning map with reused map fdtools/ | +48 | 1 reply | Applied |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | Andrii Nakryiko |
|---|---|
| 1/3 | A-b |
| 2/3 | A-b |
| 3/3 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCHv3 bpf 0/3] Fix pining maps after reuse map fd
When a user reuse map fd after creating a map manually and set the pin_path, then load the object via libbpf. bpf_object__create_maps() will skip pinning map if map fd exist. Fix it by add moving bpf creation to else condition and go on checking map pin_path after that.
v3:
for selftest: use CHECK() for bpf_object__open_file() and close map fd on error
v2:
a) close map fd if init map slots failed
b) add bpf selftest for this scenario
Hangbin Liu (3):
libbpf: close map fd if init map slots failed
libbpf: check if pin_path was set even map fd exist selftest/bpf: test pinning map with reused map fd
tools/lib/bpf/libbpf.c | 80 +++++++++++-------- .../selftests/bpf/prog_tests/pinning.c | 49 +++++++++++- 2 files changed, 94 insertions(+), 35 deletions(-)
Signature · 1 line
2.25.4