aboutsummaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/prog.c
diff options
context:
space:
mode:
authorPengcheng Yang <[email protected]>2023-05-06 03:07:19 +0000
committerDaniel Borkmann <[email protected]>2023-05-17 13:58:18 +0000
commit2a36c26fe3b8e2cf39e15e80ba1abc889a75da4f (patch)
tree7c8409b8e57913dfb54ddb0dcb252973e16f6a4d /tools/bpf/bpftool/prog.c
parentselftests/bpf: Do not use sign-file as testcase (diff)
downloadkernel-2a36c26fe3b8e2cf39e15e80ba1abc889a75da4f.tar.gz
kernel-2a36c26fe3b8e2cf39e15e80ba1abc889a75da4f.zip
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 <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Reviewed-by: Quentin Monnet <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/bpf/bpftool/prog.c')
-rw-r--r--tools/bpf/bpftool/prog.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c
index 91b6075b2db3..1f736dc29824 100644
--- a/tools/bpf/bpftool/prog.c
+++ b/tools/bpf/bpftool/prog.c
@@ -1739,7 +1739,7 @@ static int load_with_options(int argc, char **argv, bool first_prog_only)
goto err_close_obj;
}
- err = mount_bpffs_for_pin(pinfile);
+ err = mount_bpffs_for_pin(pinfile, !first_prog_only);
if (err)
goto err_close_obj;