From 102a0743326a03cd1a1202ceda21e175b7d3575c Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Tue, 20 Feb 2024 01:20:52 +0000 Subject: [PATCH] add new system file --- kernel/fs/pnode.c | 28 +++------------------------- 1 files changed, 3 insertions(+), 25 deletions(-) diff --git a/kernel/fs/pnode.c b/kernel/fs/pnode.c index 1fc2e47..468e4e6 100644 --- a/kernel/fs/pnode.c +++ b/kernel/fs/pnode.c @@ -1,15 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * linux/fs/pnode.c * * (C) Copyright IBM Corporation 2005. - * Released under GPL v2. * Author : Ram Pai (linuxram@us.ibm.com) - * */ #include <linux/mnt_namespace.h> #include <linux/mount.h> #include <linux/fs.h> #include <linux/nsproxy.h> +#include <uapi/linux/mount.h> #include "internal.h" #include "pnode.h" @@ -213,7 +213,6 @@ } /* all accesses are serialized by namespace_sem */ -static struct user_namespace *user_ns; static struct mount *last_dest, *first_source, *last_source, *dest_master; static struct mountpoint *mp; static struct hlist_head *list; @@ -245,7 +244,7 @@ } do { struct mount *parent = last_source->mnt_parent; - if (last_source == first_source) + if (peers(last_source, first_source)) break; done = parent->mnt_master == p; if (done && peers(n, parent)) @@ -259,13 +258,9 @@ type |= CL_MAKE_SHARED; } - /* Notice when we are propagating across user namespaces */ - if (m->mnt_ns->user_ns != user_ns) - type |= CL_UNPRIVILEGED; child = copy_tree(last_source, last_source->mnt.mnt_root, type); if (IS_ERR(child)) return PTR_ERR(child); - child->mnt.mnt_flags &= ~MNT_LOCKED; read_seqlock_excl(&mount_lock); mnt_set_mountpoint(m, mp, child); if (m->mnt_master != dest_master) @@ -301,7 +296,6 @@ * propagate_one(); everything is serialized by namespace_sem, * so globals will do just fine. */ - user_ns = current->nsproxy->mnt_ns->user_ns; last_dest = dest_mnt; first_source = source_mnt; last_source = source_mnt; @@ -605,20 +599,4 @@ list_splice_tail(&to_umount, list); return 0; -} - -void propagate_remount(struct mount *mnt) -{ - struct mount *parent = mnt->mnt_parent; - struct mount *p = mnt, *m; - struct super_block *sb = mnt->mnt.mnt_sb; - - if (!sb->s_op->copy_mnt_data) - return; - for (p = propagation_next(parent, parent); p; - p = propagation_next(p, parent)) { - m = __lookup_mnt(&p->mnt, mnt->mnt_mountpoint); - if (m) - sb->s_op->copy_mnt_data(m->mnt.data, mnt->mnt.data); - } } -- Gitblit v1.6.2