]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/bpf: Use memfd_create instead of shm_open in cgroup_iter_memcg
authorAlexei Starovoitov <ast@kernel.org>
Sun, 12 Apr 2026 21:06:36 +0000 (14:06 -0700)
committerKumar Kartikeya Dwivedi <memxor@gmail.com>
Sun, 12 Apr 2026 21:46:32 +0000 (23:46 +0200)
commit47687a29b2c3acc9aa553737d482645813878aed
treeaaa93bd431036dee45dc9430f071be4755e3c79c
parentfa2942918afbd0cb765277e2fd09fe0aaef6dd8d
selftests/bpf: Use memfd_create instead of shm_open in cgroup_iter_memcg

Replace shm_open/shm_unlink with memfd_create in the shmem subtest.
shm_open requires /dev/shm to be mounted, which is not always available
in test environments, causing the test to fail with ENOENT.
memfd_create creates an anonymous shmem-backed fd without any filesystem
dependency while exercising the same shmem accounting path.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20260412210636.47516-1-alexei.starovoitov@gmail.com
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
tools/testing/selftests/bpf/prog_tests/cgroup_iter_memcg.c