OSDN Git Service

bpftool: Support bpffs mountpoint as pin path for prog loadall
authorPengcheng Yang <yangpc@wangsu.com>
Sat, 6 May 2023 03:07:19 +0000 (11:07 +0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 17 May 2023 13:58:18 +0000 (15:58 +0200)
commit2a36c26fe3b8e2cf39e15e80ba1abc889a75da4f
tree7c8409b8e57913dfb54ddb0dcb252973e16f6a4d
parentf04a32b2c5b539e3c097cb5c7c1df12a8f4a0cf0
bpftool: Support bpffs mountpoint as pin path for prog loadall

Currently, when using prog loadall and the pin path is a bpffs mountpoint,
bpffs will be repeatedly mounted to the parent directory of the bpffs
mountpoint path. For example, a `bpftool prog loadall test.o /sys/fs/bpf`
will trigger this.

Signed-off-by: Pengcheng Yang <yangpc@wangsu.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/bpf/1683342439-3677-1-git-send-email-yangpc@wangsu.com
tools/bpf/bpftool/common.c
tools/bpf/bpftool/iter.c
tools/bpf/bpftool/main.h
tools/bpf/bpftool/prog.c
tools/bpf/bpftool/struct_ops.c