cgroup: kselftest: relax fs_spec checks
Subsystems (3)
PATCH 13/17 cgroup: kselftest: relax fs_spec checks
From: Chris Down <[email protected]>
Subject: cgroup: kselftest: relax fs_spec checks
On my laptop most memcg kselftests were being skipped because it claimed cgroup v2 hierarchy wasn't mounted, but this isn't correct. Instead, it seems current systemd HEAD mounts it with the name "cgroup2" instead of "cgroup":
% grep cgroup /proc/mounts
cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate 0 0
I can't think of a reason to need to check fs_spec explicitly since it's arbitrary, so we can just rely on fs_vfstype.
After these changes, make TARGETS=cgroup kselftest actually runs the cgroup v2 tests in more cases.
Signed-off-by Chris Down <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Tejun Heo <[email protected]>
Cc Roman Gushchin <[email protected]>
Cc <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
tools/testing/selftests/cgroup/cgroup_util.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
tools/testing/selftests/cgroup/cgroup_util.c renamed from tools/testing/selftests/cgroup/cgroup_util.c~cgroup-kselftest-relax-fs_spec-checks +1 -2
@@ -191,8 +191,7 @@ int cg_find_unified_root(char *root, sizstrtok (NULL , delim);strtok (NULL , delim); -if (strcmp (fs,"cgroup" ) ==0 && -strcmp (type,"cgroup2" ) ==0 ) { +if (strcmp (type,"cgroup2" ) ==0 ) {strncpy (root, mount, len);return 0 ; }
_