cgroup-util: check for SYSFS_MAGIC when detecting cgroup format
authorDan Streetman <ddstreet@canonical.com>
Sat, 21 Mar 2020 15:19:44 +0000 (11:19 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 25 Apr 2020 08:00:43 +0000 (10:00 +0200)
commit0bc5f001dbf25ea264a9b61aafd3d7362f53b7be
tree1cbd9624404bcf1902bdaa3dd77b0cabdf311428
parent84cb27086f8d7a2471e2c61679ed69371db1c1a2
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."
src/basic/cgroup-util.c