[Devel] [PATCH VZ10 v2 08/12] ve/cgroup-v2: Allow nested ve cgroup directories

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Wed Dec 10 13:34:29 MSK 2025


In cgroup-v2 we have no other way except allowing to enable ve
controller on intermidiate cgroups (e.g. machine.slice). That means we
have at least 3 levels.

https://virtuozzo.atlassian.net/browse/VSTOR-104639
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>

Feature: ve: ve generic structures
---
 kernel/ve/ve.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
index 718d7811b629..ef2d802a3949 100644
--- a/kernel/ve/ve.c
+++ b/kernel/ve/ve.c
@@ -947,7 +947,8 @@ static struct cgroup_subsys_state *ve_create(struct cgroup_subsys_state *parent_
 		goto do_init;
 
 	/* forbid nested containers */
-	if (css_to_ve(parent_css) != &ve0)
+	if (!cgroup_subsys_on_dfl(ve_cgrp_subsys) &&
+	    css_to_ve(parent_css) != &ve0)
 		return ERR_PTR(-ENOTDIR);
 
 	err = -ENOMEM;
-- 
2.52.0



More information about the Devel mailing list