[Devel] [PATCH RHEL10 COMMIT] ve/mntns: make mnt_namespace->ve_owner present in not CONFIG_VE case
Konstantin Khorenko
khorenko at virtuozzo.com
Mon May 18 13:14:30 MSK 2026
The commit is pushed to "branch-rh10-6.12.0-55.52.1.5.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-55.52.1.5.26.vz10
------>
commit 838e0898a551c7d4362f0b40243fec60695c9b05
Author: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Date: Fri May 15 13:31:42 2026 +0200
ve/mntns: make mnt_namespace->ve_owner present in not CONFIG_VE case
We already have mount->ve_owner present if CONFIG_VE is disabled and
since mnt_namespace->ve_owner is used when setting mount->ve_owner it
would be cleaner to also have it.
It both fixes the commit adding mnt_namespace->ve_owner and the one
after that which starts to use it for setting owner for mounts.
While on it put_ve(ve) already checks ve for NULL, so we can drop
excess pre-check in free_mnt_ns().
https://virtuozzo.atlassian.net/browse/VSTOR-129744
Fixes: f07a52b3f1959 ("ve/mntns: add ve_owner to struct mnt_namespace")
Fixes: 7428384902250 ("ve/mount: thread owning ve through alloc_vfsmnt/clone_mnt/copy_tree")
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Reviewed-by: Vasileios Almpanis <vasileios.almpanis at virtuozzo.com>
Feature: ve: ve generic structures
---
fs/mount.h | 2 --
fs/namespace.c | 11 +----------
2 files changed, 1 insertion(+), 12 deletions(-)
diff --git a/fs/mount.h b/fs/mount.h
index aea2dc4c082be..5cf06431d5868 100644
--- a/fs/mount.h
+++ b/fs/mount.h
@@ -20,9 +20,7 @@ struct mnt_namespace {
struct rb_node mnt_ns_tree_node; /* node in the mnt_ns_tree */
refcount_t passive; /* number references not pinning @mounts */
struct list_head mntns_list;
-#ifdef CONFIG_VE
struct ve_struct *ve_owner;
-#endif
} __randomize_layout;
struct mnt_pcp {
diff --git a/fs/namespace.c b/fs/namespace.c
index 865635366fd7e..acd4507e12472 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -4147,10 +4147,7 @@ static void free_mnt_ns(struct mnt_namespace *ns)
list_del(&ns->mntns_list);
spin_unlock(&all_mntns_list_lock);
-#ifdef CONFIG_VE
- if (ns->ve_owner)
- put_ve(ns->ve_owner);
-#endif
+ put_ve(ns->ve_owner);
mnt_ns_tree_remove(ns);
}
@@ -4204,9 +4201,7 @@ static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns,
init_waitqueue_head(&new_ns->poll);
new_ns->user_ns = get_user_ns(user_ns);
new_ns->ucounts = ucounts;
-#ifdef CONFIG_VE
new_ns->ve_owner = get_ve(new_ve ?: get_exec_env());
-#endif
return new_ns;
}
@@ -4241,11 +4236,7 @@ struct mnt_namespace *copy_mnt_ns(unsigned long flags, struct mnt_namespace *ns,
copy_flags = CL_COPY_UNBINDABLE | CL_EXPIRE;
if (user_ns != ns->user_ns)
copy_flags |= CL_SHARED_TO_SLAVE;
-#ifdef CONFIG_VE
new = copy_tree(old, old->mnt.mnt_root, copy_flags, new_ns->ve_owner);
-#else
- new = copy_tree(old, old->mnt.mnt_root, copy_flags, NULL);
-#endif
if (IS_ERR(new)) {
namespace_unlock();
ns_free_inum(&new_ns->ns);
More information about the Devel
mailing list