aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2010-04-22 05:30:00 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2010-05-04 12:25:00 -0400
commitfae9c791703606636c1220e47f6690660042ce7f (patch)
treec4d1bf20f4b73ee438ae2c3168b9b7ead1418215 /kernel
parent9a9686b634acc5cb6b7c601c171ae64af0318a24 (diff)
cgroup: Fix an RCU warning in alloc_css_id()
With CONFIG_PROVE_RCU=y, a warning can be triggered: # mount -t cgroup -o memory xxx /mnt # mkdir /mnt/0 ... kernel/cgroup.c:4442 invoked rcu_dereference_check() without protection! ... This is a false-positive. It's safe to directly access parent_css->id. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cgroup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 4ca928db890c..3a53c771e503 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4561,13 +4561,13 @@ static int alloc_css_id(struct cgroup_subsys *ss, struct cgroup *parent,
4561{ 4561{
4562 int subsys_id, i, depth = 0; 4562 int subsys_id, i, depth = 0;
4563 struct cgroup_subsys_state *parent_css, *child_css; 4563 struct cgroup_subsys_state *parent_css, *child_css;
4564 struct css_id *child_id, *parent_id = NULL; 4564 struct css_id *child_id, *parent_id;
4565 4565
4566 subsys_id = ss->subsys_id; 4566 subsys_id = ss->subsys_id;
4567 parent_css = parent->subsys[subsys_id]; 4567 parent_css = parent->subsys[subsys_id];
4568 child_css = child->subsys[subsys_id]; 4568 child_css = child->subsys[subsys_id];
4569 depth = css_depth(parent_css) + 1;
4570 parent_id = parent_css->id; 4569 parent_id = parent_css->id;
4570 depth = parent_id->depth;
4571 4571
4572 child_id = get_new_cssid(ss, depth); 4572 child_id = get_new_cssid(ss, depth);
4573 if (IS_ERR(child_id)) 4573 if (IS_ERR(child_id))