From 4141e148e629eb9ca161354635ae40de55d8f552 Mon Sep 17 00:00:00 2001 From: Shaojie Sun Date: Thu, 3 Sep 2026 14:48:28 +0800 Subject: 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 Link: https://patch.msgid.link/20260903064828.126643-4-sunshaojie@kylinos.cn Reviewed-by: Tao Cui Reviewed-by: Jan Kara Signed-off-by: Christian Brauner (Amutable) --- 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; -- cgit v1.2.3