From 09f0aa179a503ed0cde20a9eb802f49669646977 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Mon, 19 Nov 2012 08:13:36 -0800 Subject: [PATCH] --- yaml --- r: 339335 b: refs/heads/master c: febfcef60d4f9457785b45aab548bc7ee5ea158f h: refs/heads/master i: 339333: ecfe69f636db62e59058c2dfa09337e77c61f666 339331: c0b18906e93c66a47d595bd9d4b6b385f99bb7e4 339327: 03f752cf0bbd1a86c612368f05a76eb40cb19f87 v: v3 --- [refs] | 2 +- trunk/include/linux/cgroup.h | 2 +- trunk/kernel/cgroup.c | 11 ++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 73989cf29fc6..f49fe0b92ce1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4e139afc22cb98d0d032ffce0285bfcc73ca5217 +refs/heads/master: febfcef60d4f9457785b45aab548bc7ee5ea158f diff --git a/trunk/include/linux/cgroup.h b/trunk/include/linux/cgroup.h index 8f64b459fbd4..d605857c4bf3 100644 --- a/trunk/include/linux/cgroup.h +++ b/trunk/include/linux/cgroup.h @@ -165,7 +165,7 @@ struct cgroup { struct list_head files; /* my files */ struct cgroup *parent; /* my parent */ - struct dentry __rcu *dentry; /* cgroup fs entry, RCU protected */ + struct dentry *dentry; /* cgroup fs entry, RCU protected */ /* Private pointers for each registered subsystem */ struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; diff --git a/trunk/kernel/cgroup.c b/trunk/kernel/cgroup.c index d62a529db2f7..affc76d7f739 100644 --- a/trunk/kernel/cgroup.c +++ b/trunk/kernel/cgroup.c @@ -1756,9 +1756,11 @@ static struct kobject *cgroup_kobj; */ int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen) { + struct dentry *dentry = cgrp->dentry; char *start; - struct dentry *dentry = rcu_dereference_check(cgrp->dentry, - cgroup_lock_is_held()); + + rcu_lockdep_assert(rcu_read_lock_held() || cgroup_lock_is_held(), + "cgroup_path() called without proper locking"); if (!dentry || cgrp == dummytop) { /* @@ -1782,8 +1784,7 @@ int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen) if (!cgrp) break; - dentry = rcu_dereference_check(cgrp->dentry, - cgroup_lock_is_held()); + dentry = cgrp->dentry; if (!cgrp->parent) continue; if (--start < buf) @@ -4124,7 +4125,7 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry, /* allocation complete, commit to creation */ dentry->d_fsdata = cgrp; - rcu_assign_pointer(cgrp->dentry, dentry); + cgrp->dentry = dentry; list_add_tail(&cgrp->allcg_node, &root->allcg_list); list_add_tail_rcu(&cgrp->sibling, &cgrp->parent->children); root->number_of_cgroups++;