From: Tejun Heo <tj@kernel.org>
To: Naresh Kamboju <naresh.kamboju@linaro.org>
Cc: cgroups@vger.kernel.org,
Linux-Next Mailing List <linux-next@vger.kernel.org>,
namhyung@kernel.org, open list <linux-kernel@vger.kernel.org>,
lkft-triage@lists.linaro.org, lizefan@huawei.com,
hannes@cmpxchg.org, Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
kafai@fb.com, Song Liu <songliubraving@fb.com>
Subject: [PATCH cgroup/for-5.5] cgroup: fix incorrect WARN_ON_ONCE() in cgroup_setup_root()
Date: Thu, 14 Nov 2019 14:54:08 -0800 [thread overview]
Message-ID: <20191114225408.GO4163745@devbig004.ftw2.facebook.com> (raw)
In-Reply-To: <20191114224213.GN4163745@devbig004.ftw2.facebook.com>
Never mind. I just failed to see the warning on x86_32. The warning
is spurious and fixed with the following commit. Applied to
cgroup/for-5.5.
Thanks.
------ 8< ------
From d7495343228f30d8206e92dccfd1c41adcfa142d Mon Sep 17 00:00:00 2001
From: Tejun Heo <tj@kernel.org>
Date: Thu, 14 Nov 2019 14:46:51 -0800
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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index c12dcf7dc432..53098c1d45e2 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -1966,7 +1966,7 @@ int cgroup_setup_root(struct cgroup_root *root, u16 ss_mask)
goto exit_root_id;
}
root_cgrp->kn = root->kf_root->kn;
- WARN_ON_ONCE(cgroup_id(root_cgrp) != 1);
+ WARN_ON_ONCE(cgroup_ino(root_cgrp) != 1);
root_cgrp->ancestor_ids[0] = cgroup_id(root_cgrp);
ret = css_populate_dir(&root_cgrp->self);
--
2.17.1
next prev parent reply other threads:[~2019-11-14 22:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-14 5:32 linux-next: arm32: beagleboard x15: WARNING: CPU: 0 PID: 0 at /usr/src/kernel/kernel/cgroup/cgroup.c:1969 cgroup_setup_root+0x36c/0x4e8 Naresh Kamboju
2019-11-14 22:42 ` Tejun Heo
2019-11-14 22:54 ` Tejun Heo [this message]
2019-11-15 8:58 ` Naresh Kamboju
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191114225408.GO4163745@devbig004.ftw2.facebook.com \
--to=tj@kernel.org \
--cc=ast@kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=hannes@cmpxchg.org \
--cc=kafai@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=lkft-triage@lists.linaro.org \
--cc=namhyung@kernel.org \
--cc=naresh.kamboju@linaro.org \
--cc=songliubraving@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox