mirror of https://github.com/torvalds/linux.git
ns: drop custom reference count initialization for initial namespaces
Initial namespaces don't modify their reference count anymore. They remain fixed at one so drop the custom refcount initializations. Link: https://patch.msgid.link/20251110-work-namespace-nstree-fixes-v1-16-e8a9264e0fb9@kernel.org Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
282879afa0
commit
c2bbd2db52
|
|
@ -5986,7 +5986,7 @@ SYSCALL_DEFINE4(listmount, const struct mnt_id_req __user *, req,
|
|||
}
|
||||
|
||||
struct mnt_namespace init_mnt_ns = {
|
||||
.ns = NS_COMMON_INIT(init_mnt_ns, 1),
|
||||
.ns = NS_COMMON_INIT(init_mnt_ns),
|
||||
.user_ns = &init_user_ns,
|
||||
.passive = REFCOUNT_INIT(1),
|
||||
.mounts = RB_ROOT,
|
||||
|
|
|
|||
|
|
@ -26,14 +26,14 @@ static __always_inline bool is_ns_init_id(const struct ns_common *ns)
|
|||
return ns->ns_id <= NS_LAST_INIT_ID;
|
||||
}
|
||||
|
||||
#define NS_COMMON_INIT(nsname, refs) \
|
||||
#define NS_COMMON_INIT(nsname) \
|
||||
{ \
|
||||
.ns_type = ns_common_type(&nsname), \
|
||||
.ns_id = ns_init_id(&nsname), \
|
||||
.inum = ns_init_inum(&nsname), \
|
||||
.ops = to_ns_operations(&nsname), \
|
||||
.stashed = NULL, \
|
||||
.__ns_ref = REFCOUNT_INIT(refs), \
|
||||
.__ns_ref = REFCOUNT_INIT(1), \
|
||||
.__ns_ref_active = ATOMIC_INIT(1), \
|
||||
.ns_unified_node.ns_list_entry = LIST_HEAD_INIT(nsname.ns.ns_unified_node.ns_list_entry), \
|
||||
.ns_tree_node.ns_list_entry = LIST_HEAD_INIT(nsname.ns.ns_tree_node.ns_list_entry), \
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#include <linux/utsname.h>
|
||||
|
||||
struct uts_namespace init_uts_ns = {
|
||||
.ns = NS_COMMON_INIT(init_uts_ns, 2),
|
||||
.ns = NS_COMMON_INIT(init_uts_ns),
|
||||
.name = {
|
||||
.sysname = UTS_SYSNAME,
|
||||
.nodename = UTS_NODENAME,
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ DEFINE_SPINLOCK(mq_lock);
|
|||
* and not CONFIG_IPC_NS.
|
||||
*/
|
||||
struct ipc_namespace init_ipc_ns = {
|
||||
.ns = NS_COMMON_INIT(init_ipc_ns, 1),
|
||||
.ns = NS_COMMON_INIT(init_ipc_ns),
|
||||
.user_ns = &init_user_ns,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ bool cgroup_enable_per_threadgroup_rwsem __read_mostly;
|
|||
|
||||
/* cgroup namespace for init task */
|
||||
struct cgroup_namespace init_cgroup_ns = {
|
||||
.ns = NS_COMMON_INIT(init_cgroup_ns, 2),
|
||||
.ns = NS_COMMON_INIT(init_cgroup_ns),
|
||||
.user_ns = &init_user_ns,
|
||||
.root_cset = &init_css_set,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ static int pid_max_max = PID_MAX_LIMIT;
|
|||
* the scheme scales to up to 4 million PIDs, runtime.
|
||||
*/
|
||||
struct pid_namespace init_pid_ns = {
|
||||
.ns = NS_COMMON_INIT(init_pid_ns, 2),
|
||||
.ns = NS_COMMON_INIT(init_pid_ns),
|
||||
.idr = IDR_INIT(init_pid_ns.idr),
|
||||
.pid_allocated = PIDNS_ADDING,
|
||||
.level = 0,
|
||||
|
|
|
|||
|
|
@ -478,7 +478,7 @@ const struct proc_ns_operations timens_for_children_operations = {
|
|||
};
|
||||
|
||||
struct time_namespace init_time_ns = {
|
||||
.ns = NS_COMMON_INIT(init_time_ns, 3),
|
||||
.ns = NS_COMMON_INIT(init_time_ns),
|
||||
.user_ns = &init_user_ns,
|
||||
.frozen_offsets = true,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ EXPORT_SYMBOL_GPL(init_binfmt_misc);
|
|||
* and 1 for... ?
|
||||
*/
|
||||
struct user_namespace init_user_ns = {
|
||||
.ns = NS_COMMON_INIT(init_user_ns, 3),
|
||||
.ns = NS_COMMON_INIT(init_user_ns),
|
||||
.uid_map = {
|
||||
{
|
||||
.extent[0] = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue