From: Tao Cui <cui.tao@linux.dev>
To: "Shaojie Sun" <sunshaojie@kylinos.cn>,
"Tejun Heo" <tj@kernel.org>,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Michal Koutný" <mkoutny@suse.com>,
"Christian Brauner" <brauner@kernel.org>,
"Alexander Viro" <viro@zeniv.linux.org.uk>
Cc: cui.tao@linux.dev, Jan Kara <jack@suse.cz>,
Pavel Tikhomirov <ptikhomirov@virtuozzo.com>,
cgroups@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] cgroup: namespace: drop BUG_ON() in copy_cgroup_ns()
Date: Thu, 3 Sep 2026 17:28:48 +0800 [thread overview]
Message-ID: <7fb0d5df-6d16-477a-a140-377158b0fa05@linux.dev> (raw)
In-Reply-To: <20260903064828.126643-2-sunshaojie@kylinos.cn>
在 2026/9/3 14:48, Shaojie Sun 写道:
> The sole caller, create_new_namespaces(), always passes a valid cgroup
> namespace pointer from the task's nsproxy. The other copy_*_ns()
> helpers, e.g. copy_time_ns() and copy_pid_ns(), don't perform such a
> check either. Drop the BUG_ON() for consistency with them.
>
> Signed-off-by: Shaojie Sun <sunshaojie@kylinos.cn>
> ---
> kernel/cgroup/namespace.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/kernel/cgroup/namespace.c b/kernel/cgroup/namespace.c
> index ea4ee13936be..76660332ec64 100644
> --- a/kernel/cgroup/namespace.c
> +++ b/kernel/cgroup/namespace.c
> @@ -53,8 +53,6 @@ struct cgroup_namespace *copy_cgroup_ns(u64 flags,
> struct ucounts *ucounts;
> struct css_set *cset;
>
> - BUG_ON(!old_ns);
> -
> if (!(flags & CLONE_NEWCGROUP)) {
> get_cgroup_ns(old_ns);
> return old_ns;
Reviewed-by: Tao Cui <cuitao@kylinos.cn>
next prev parent reply other threads:[~2026-09-03 9:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 10:18 [PATCH] cgroup: namespace: replace BUG_ON() in copy_cgroup_ns() with WARN_ON_ONCE() Shaojie Sun
2026-09-02 18:56 ` Michal Koutný
2026-09-03 6:48 ` [PATCH v2 0/3] drop BUG_ON() NULL checks in namespace copy helpers Shaojie Sun
2026-09-03 6:48 ` [PATCH v2 1/3] cgroup: namespace: drop BUG_ON() in copy_cgroup_ns() Shaojie Sun
2026-09-03 9:28 ` Tao Cui [this message]
2026-09-03 16:47 ` Tejun Heo
2026-09-03 6:48 ` [PATCH v2 2/3] uts: drop BUG_ON() in copy_utsname() Shaojie Sun
2026-09-03 8:40 ` Bradley Morgan
2026-09-03 6:48 ` [PATCH v2 3/3] fs: namespace: drop BUG_ON() in copy_mnt_ns() Shaojie Sun
2026-09-03 9:29 ` Tao Cui
2026-09-03 10:43 ` Jan Kara
2026-09-03 8:02 ` [PATCH v2 0/3] drop BUG_ON() NULL checks in namespace copy helpers Shaojie Sun
2026-09-04 10:48 ` (subset) " Christian Brauner
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=7fb0d5df-6d16-477a-a140-377158b0fa05@linux.dev \
--to=cui.tao@linux.dev \
--cc=brauner@kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkoutny@suse.com \
--cc=ptikhomirov@virtuozzo.com \
--cc=sunshaojie@kylinos.cn \
--cc=tj@kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.