[Devel] [PATCH RH9 5/6] ve: use rcu_dereference for ve_ns in ve_get_init_css
Pavel Tikhomirov
ptikhomirov at virtuozzo.com
Tue Oct 12 19:22:08 MSK 2021
From: Kirill Tkhai <ktkhai at virtuozzo.com>
vz9 changes: drop css_local_root hunk as excess, we already have root ve
cgroup from ve cgroup ns css set it's not connected with init task
anymore after we've switched to cgroup namespaces; cleanup comments as
unrelated and rename patch.
https://jira.sw.ru/browse/PSBM-134002
(cherry picked from vz8 commit c1b584c0d3bef695eef60841f22a2e6d90e23da4)
Fixes: 87e54c0229a4 ("ve: Add ve cgroup and ve_hook subsys")
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
kernel/ve/ve.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
index 5acd2baa2a08..847179044066 100644
--- a/kernel/ve/ve.c
+++ b/kernel/ve/ve.c
@@ -282,7 +282,10 @@ struct cgroup_subsys_state *ve_get_init_css(struct ve_struct *ve, int subsys_id)
rcu_read_lock();
- nsproxy = ve->ve_ns ? : &init_nsproxy;
+ nsproxy = rcu_dereference(ve->ve_ns);
+ if (!nsproxy)
+ nsproxy = &init_nsproxy;
+
root_cset = nsproxy->cgroup_ns->root_cset;
css = root_cset->subsys[subsys_id];
/* nsproxy->cgroup_ns must hold root_cset refcnt */
--
2.31.1
More information about the Devel
mailing list