[Devel] [PATCH RHEL7 COMMIT] ve/cgroup: remove rcu_read_lock from cgroup_get_ve_root

Konstantin Khorenko khorenko at virtuozzo.com
Tue Nov 7 12:06:19 MSK 2017


The commit is pushed to "branch-rh7-3.10.0-693.1.1.vz7.37.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.1.1.vz7.37.21
------>
commit f8168436b4eb925096fe7f14bfc18b0789aa6b3c
Author: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Date:   Tue Nov 7 12:06:19 2017 +0300

    ve/cgroup: remove rcu_read_lock from cgroup_get_ve_root
    
    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 at virtuozzo.com>
    Reviewed-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 kernel/cgroup.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index f960c34..06863de 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;
 }


More information about the Devel mailing list