[RH7,1/3] cgroup: remove rcu_read_lock from cgroup_get_ve_root

Submitted by Pavel Tikhomirov on Nov. 1, 2017, 1:49 p.m.

Details

Message ID 20171101134911.31805-2-ptikhomirov@virtuozzo.com
State New
Series "ve: properly handle nr_cpus and cpu_rate for nested cgroups"
Headers show

Commit Message

Pavel Tikhomirov Nov. 1, 2017, 1:49 p.m.
It is likely a leftover from __cgroup_path where it protects cgrp->name
in cgroup_get_ve_root there is nothing rcu_dereferenced, also in
cgroup_is_descendant there is no rcu for cgrp->parent.

https://jira.sw.ru/browse/PSBM-69678
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
 kernel/cgroup.c | 2 --
 1 file changed, 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index f960c342aef8..06863de12c6e 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4284,7 +4284,6 @@  static struct cgroup *cgroup_get_ve_root(struct cgroup *cgrp)
 {
 	struct cgroup *ve_root = NULL;
 
-	rcu_read_lock();
 	do {
 		if (test_bit(CGRP_VE_ROOT, &cgrp->flags)) {
 			ve_root = cgrp;
@@ -4292,7 +4291,6 @@  static struct cgroup *cgroup_get_ve_root(struct cgroup *cgrp)
 		}
 		cgrp = cgrp->parent;
 	} while (cgrp);
-	rcu_read_unlock();
 
 	return ve_root;
 }