selftests/bpf: Make sure mount directory exists
The mount directory for the selftests cgroup tree might not exist so let's make sure it does exist by creating it ourselves if it doesn't exist. Signed-off-by: Daan De Meyer <daan.j.demeyer@gmail.com> Link: https://lore.kernel.org/r/20231011185113.140426-9-daan.j.demeyer@gmail.com Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
This commit is contained in:
parent
3243fef6a4
commit
af2752ed45
|
|
@ -199,6 +199,11 @@ int setup_cgroup_environment(void)
|
|||
|
||||
format_cgroup_path(cgroup_workdir, "");
|
||||
|
||||
if (mkdir(CGROUP_MOUNT_PATH, 0777) && errno != EEXIST) {
|
||||
log_err("mkdir mount");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (unshare(CLONE_NEWNS)) {
|
||||
log_err("unshare");
|
||||
return 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue