summaryrefslogtreecommitdiffstats
path: root/src/basic/cgroup-util.c
diff options
context:
space:
mode:
authorDan Streetman <ddstreet@canonical.com>2020-03-21 16:19:44 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-04-25 10:00:43 +0200
commit0bc5f001dbf25ea264a9b61aafd3d7362f53b7be (patch)
tree1cbd9624404bcf1902bdaa3dd77b0cabdf311428 /src/basic/cgroup-util.c
parentImprove help for clang-format (diff)
downloadsystemd-0bc5f001dbf25ea264a9b61aafd3d7362f53b7be.tar.xz
systemd-0bc5f001dbf25ea264a9b61aafd3d7362f53b7be.zip
cgroup-util: check for SYSFS_MAGIC when detecting cgroup format
When nothing at all is mounted at /sys/fs/cgroup, the fs.f_type is SYSFS_MAGIC (0x62656572) which results in the confusing debug log: "Unknown filesystem type 62656572 mounted on /sys/fs/cgroup." Instead, if the f_type is SYSFS_MAGIC, a more accurate message is: "No filesystem is currently mounted on /sys/fs/cgroup."
Diffstat (limited to 'src/basic/cgroup-util.c')
-rw-r--r--src/basic/cgroup-util.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
index be73cfa3f0..33575e65ef 100644
--- a/src/basic/cgroup-util.c
+++ b/src/basic/cgroup-util.c
@@ -2010,6 +2010,9 @@ int cg_unified_cached(bool flush) {
unified_cache = CGROUP_UNIFIED_NONE;
}
}
+ } else if (F_TYPE_EQUAL(fs.f_type, SYSFS_MAGIC)) {
+ return log_debug_errno(SYNTHETIC_ERRNO(ENOMEDIUM),
+ "No filesystem is currently mounted on /sys/fs/cgroup.");
} else
return log_debug_errno(SYNTHETIC_ERRNO(ENOMEDIUM),
"Unknown filesystem type %llx mounted on /sys/fs/cgroup.",