selftests/bpf: Fix umount cgroup2 error in test_sockmap
authorGeliang Tang <tanggeliang@kylinos.cn>
Tue, 9 Apr 2024 05:18:40 +0000 (13:18 +0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Thu, 11 Apr 2024 17:29:25 +0000 (10:29 -0700)
commitd75142dbeb2bd1587b9cc19f841578f541275a64
tree5590ecccac81480f8d3ec256d7d554e2055f30b5
parentffa6b26b4d8a0520b78636ca9373ab842cb3b1a8
selftests/bpf: Fix umount cgroup2 error in test_sockmap

This patch fixes the following "umount cgroup2" error in test_sockmap.c:

 (cgroup_helpers.c:353: errno: Device or resource busy) umount cgroup2

Cgroup fd cg_fd should be closed before cleanup_cgroup_environment().

Fixes: 13a5f3ffd202 ("bpf: Selftests, sockmap test prog run without setting cgroup")
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/0399983bde729708773416b8488bac2cd5e022b8.1712639568.git.tanggeliang@kylinos.cn
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
tools/testing/selftests/bpf/test_sockmap.c