]> git.baikalelectronics.ru Git - kernel.git/commit
cgroup: fix incorrect WARN_ON_ONCE() in cgroup_setup_root()
authorTejun Heo <tj@kernel.org>
Thu, 14 Nov 2019 22:46:51 +0000 (14:46 -0800)
committerTejun Heo <tj@kernel.org>
Thu, 14 Nov 2019 22:46:51 +0000 (14:46 -0800)
commite8bd804b5104194a53f2361c6c969cb04908b3f2
tree0e4aa6672470c7b17555c04d19f7d6bded19c512
parent4f605c3e893eea230b20c6ee5ec39b291d7ab404
cgroup: fix incorrect WARN_ON_ONCE() in cgroup_setup_root()

4f605c3e893e ("cgroup: use cgrp->kn->id as the cgroup ID") added WARN
which triggers if cgroup_id(root_cgrp) is not 1.  This is fine on
64bit ino archs but on 32bit archs cgroup ID is ((gen << 32) | ino)
and gen starts at 1, so the root id is 0x1_0000_0001 instead of 1
always triggering the WARN.

What we wanna make sure is that the ino part is 1.  Fix it.

Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Fixes: 4f605c3e893e ("cgroup: use cgrp->kn->id as the cgroup ID")
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cgroup.c