Skip to content

Commit b59b1ba

Browse files
cdowntorvalds
authored andcommitted
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. Link: http://lkml.kernel.org/r/20190723210737.GA487@chrisdown.name Signed-off-by: Chris Down <chris@chrisdown.name> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Tejun Heo <tj@kernel.org> Cc: Roman Gushchin <guro@fb.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent aa4996b commit b59b1ba

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎tools/testing/selftests/cgroup/cgroup_util.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,7 @@ int cg_find_unified_root(char *root, size_t len)
191191
strtok(NULL, delim);
192192
strtok(NULL, delim);
193193

194-
if (strcmp(fs, "cgroup") == 0 &&
195-
strcmp(type, "cgroup2") == 0) {
194+
if (strcmp(type, "cgroup2") == 0) {
196195
strncpy(root, mount, len);
197196
return 0;
198197
}

0 commit comments

Comments
 (0)