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)
commitd7495343228f30d8206e92dccfd1c41adcfa142d
tree0e4aa6672470c7b17555c04d19f7d6bded19c512
parent743210386c0354a2f8ef3d697353c7d8477fa81d
cgroup: fix incorrect WARN_ON_ONCE() in cgroup_setup_root()

743210386c03 ("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: 743210386c03 ("cgroup: use cgrp->kn->id as the cgroup ID")
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cgroup.c