Skip to content

Commit d749534

Browse files
committed
cgroup: fix incorrect WARN_ON_ONCE() in cgroup_setup_root()
7432103 ("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: 7432103 ("cgroup: use cgrp->kn->id as the cgroup ID") Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 7432103 commit d749534

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/cgroup/cgroup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1966,7 +1966,7 @@ int cgroup_setup_root(struct cgroup_root *root, u16 ss_mask)
19661966
goto exit_root_id;
19671967
}
19681968
root_cgrp->kn = root->kf_root->kn;
1969-
WARN_ON_ONCE(cgroup_id(root_cgrp) != 1);
1969+
WARN_ON_ONCE(cgroup_ino(root_cgrp) != 1);
19701970
root_cgrp->ancestor_ids[0] = cgroup_id(root_cgrp);
19711971

19721972
ret = css_populate_dir(&root_cgrp->self);

0 commit comments

Comments
 (0)