[Devel] [PATCH RHEL10 COMMIT] ve: Enable files on cgroup-v2

Konstantin Khorenko khorenko at virtuozzo.com
Sat Dec 13 23:29:16 MSK 2025


The commit is pushed to "branch-rh10-6.12.0-55.13.1.3.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-55.13.1.2.24.vz10
------>
commit c6d46f0e8b56470f8f8d7424790d2773cde89a6b
Author: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Date:   Wed Dec 10 18:34:23 2025 +0800

    ve: Enable files on cgroup-v2
    
    All ve_cftypes and also sysfs_ve_cftypes. Now ve controller can be
    enabled on default hierarchy via cgroup.subtree_controll and will show
    those files.
    
    https://virtuozzo.atlassian.net/browse/VSTOR-119804
    Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
    
    Feature: ve: ve generic structures
---
 fs/sysfs/ve.c          | 2 +-
 include/linux/cgroup.h | 1 +
 kernel/cgroup/cgroup.c | 2 +-
 kernel/ve/ve.c         | 1 +
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/sysfs/ve.c b/fs/sysfs/ve.c
index 9ddabac94c2f3..eb941a1d5dd53 100644
--- a/fs/sysfs/ve.c
+++ b/fs/sysfs/ve.c
@@ -103,6 +103,6 @@ static struct cftype sysfs_ve_cftypes[] = {
 
 static int init_sysfve_perms(void)
 {
-	return cgroup_add_legacy_cftypes(&ve_cgrp_subsys, sysfs_ve_cftypes);
+	return cgroup_add_cftypes(&ve_cgrp_subsys, sysfs_ve_cftypes);
 }
 module_init(init_sysfve_perms);
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 6fe5422e27b93..204b629144954 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -111,6 +111,7 @@ struct cgroup *cgroup_v1v2_get_from_fd(int fd);
 int cgroup_attach_task_all(struct task_struct *from, struct task_struct *);
 int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from);
 
+int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
 int cgroup_add_dfl_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
 int cgroup_add_legacy_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
 int cgroup_rm_cftypes(struct cftype *cfts);
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 3779cd1adcd10..14f21de399adf 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -5072,7 +5072,7 @@ int cgroup_rm_cftypes(struct cftype *cfts)
  * function currently returns 0 as long as @cfts registration is successful
  * even if some file creation attempts on existing cgroups fail.
  */
-static int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts)
+int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts)
 {
 	int ret;
 
diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
index e66ba6fe1a633..84e23b7e61ee9 100644
--- a/kernel/ve/ve.c
+++ b/kernel/ve/ve.c
@@ -1906,6 +1906,7 @@ struct cgroup_subsys ve_cgrp_subsys = {
 	.can_attach	= ve_can_attach,
 	.attach		= ve_attach,
 	.legacy_cftypes	= ve_cftypes,
+	.dfl_cftypes	= ve_cftypes,
 };
 
 static int __init ve_subsys_init(void)


More information about the Devel mailing list