diff options
| author | Shaojie Sun <sunshaojie@kylinos.cn> | 2026-09-03 14:48:28 +0800 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-09-04 12:46:45 +0200 |
| commit | 4141e148e629eb9ca161354635ae40de55d8f552 (patch) | |
| tree | dd510c46a5dbe3e97a7418b4f1f16cbd62e2c3cd | |
| parent | d54cc3a5272c29129ec53ac9a35ba694df7eea29 (diff) | |
| download | linux-next-4141e148e629eb9ca161354635ae40de55d8f552.tar.gz linux-next-4141e148e629eb9ca161354635ae40de55d8f552.zip | |
fs: namespace: drop BUG_ON() in copy_mnt_ns()
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>
Link: https://patch.msgid.link/20260903064828.126643-4-sunshaojie@kylinos.cn
Reviewed-by: Tao Cui <cuitao@kylinos.cn>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
| -rw-r--r-- | fs/namespace.c | 2 |
1 files changed, 0 insertions, 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; |
