cgroup_hierarchical_stats mounts a bpffs on /sys/fs/bpf to pin its
iterators, then moves into a private mount namespace to set up its
cgroups, and unmounts the bpffs in the end if it mounted it itself.

The bpffs lands in the mount namespace shared with the tests running
in parallel, on top of the one already there, and hides what they pin,
which makes bpftool_maps_access and bpftool_metadata fail now and then.
The unmount can't remove it from there, and it checks the other way
around whether the test mounted a bpffs anyway.

Patch 1 mounts the bpffs in the private mount namespace, patch 2 makes
the cleanup unmount the bpffs that the test mounted.

Signed-off-by: Qiliang Yuan <[email protected]>
---
V1 -> V2:
- Mount the bpffs in the private mount namespace instead of skipping the
  mount when /sys/fs/bpf is a bpffs already (Yosry, CI bot)
- Put that patch first, so that the unmount fix applies to a bpffs it can
  actually unmount
- Pick up Reviewed-by from Yosry on the unmount fix

v1: 
https://lore.kernel.org/r/20261008-selftests-bpf-cgroup-stats-bpffs-v1-0-76b9a6d1b...@gmail.com

---
Qiliang Yuan (2):
      selftests/bpf: Keep the bpffs of cgroup_hierarchical_stats private
      selftests/bpf: Unmount the bpffs that cgroup_hierarchical_stats mounted

 tools/testing/selftests/bpf/prog_tests/cgroup_hierarchical_stats.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
base-commit: e1d84a37cba984388988d2f1ddc84561413f0db2
change-id: 20261008-selftests-bpf-cgroup-stats-bpffs-4534db24d15c

Best regards,
-- 
Qiliang Yuan <[email protected]>


Reply via email to