On 5/23/23 7:00 PM, Andrii Nakryiko wrote:
Add ability to specify pinning location within BPF FS using O_PATH-based FDs, similar to openat() family of APIs. Patch #2 adds necessary kernel-side changes. Patch #3 exposes this through libbpf APIs. Patch #4 uses new mount APIs (fsopen, fsconfig, fsmount) to demonstrated how now it's possible to work with detach-mounted BPF FS using new BPF_OBJ_PIN and BPF_OBJ_GET functionality. We also add few more tests using various combinations of path_fd and pathname to validate proper argument propagation in kernel code. This feature is inspired as a result of recent conversations during LSF/MM/BPF 2023 conference about shortcomings of being able to perform BPF objects pinning only using lookup-based paths. v3->v4: - libbpf v1.3 bump (Daniel);
Looks good, applied 2-4 now. (Patch 1 was already in the tree.) Thanks!