Thread (2 messages) flat view 2 messages, 2 authors, 2021-09-21

Re: [PATCH iproute2] lib: bpf_legacy: fix bpffs mount when /sys/fs/bpf exists

From: Toke Høiland-Jørgensen <hidden>
Date: 2021-09-21 10:04:25

Andrea Claudi [off-list ref] writes:
bpf selftests using iproute2 fails with:

$ ip link set dev veth0 xdp object ../bpf/xdp_dummy.o section xdp_dummy
Continuing without mounted eBPF fs. Too old kernel?
mkdir (null)/globals failed: No such file or directory
Unable to load program

This happens when the /sys/fs/bpf directory exists. In this case, mkdir
in bpf_mnt_check_target() fails with errno == EEXIST, and the function
returns -1. Thus bpf_get_work_dir() does not call bpf_mnt_fs() and the
bpffs is not mounted.

Fix this in bpf_mnt_check_target(), returning 0 when the mountpoint
exists.

Fixes: d4fcdbbec9df ("lib/bpf: Fix and simplify bpf_mnt_check_target()")
Reported-by: Mingyu Shi <redacted>
Reported-by: Jiri Benc <redacted>
Suggested-by: Jiri Benc <redacted>
Signed-off-by: Andrea Claudi <redacted>
Reviewed-by: Toke Høiland-Jørgensen <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help