Linux filesystem development
 help / color / mirror / Atom feed
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 3/3] fs: namespace: drop BUG_ON() in copy_mnt_ns()
Date: Thu, 3 Sep 2026 17:29:15 +0800	[thread overview]
Message-ID: <8ef29e46-4edd-43ce-a3cc-0bb4794e861e@linux.dev> (raw)
In-Reply-To: <20260903064828.126643-4-sunshaojie@kylinos.cn>



在 2026/9/3 14:48, Shaojie Sun 写道:
> The sole caller, create_new_namespaces(), always passes a valid mount
> 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>
> ---
>  fs/namespace.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/fs/namespace.c b/fs/namespace.c
> index 1ecd96c918b3..0f35c8c14027 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -4247,8 +4247,6 @@ struct mnt_namespace *copy_mnt_ns(u64 flags, struct mnt_namespace *ns,
>  	struct mount *new;
>  	int copy_flags;
>  
> -	BUG_ON(!ns);
> -
>  	if (likely(!(flags & CLONE_NEWNS))) {
>  		get_mnt_ns(ns);
>  		return ns;
Reviewed-by: Tao Cui <cuitao@kylinos.cn>


  reply	other threads:[~2026-09-03  9:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <aphwXq5bEQwKhqx2@localhost.localdomain>
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
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 [this message]
2026-09-03 10:43     ` Jan Kara
2026-09-04 10:48   ` (subset) [PATCH v2 0/3] drop BUG_ON() NULL checks in namespace copy helpers 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=8ef29e46-4edd-43ce-a3cc-0bb4794e861e@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox