diff options
-rw-r--r-- | include/linux/cgroup.h | 2 | ||||
-rw-r--r-- | kernel/cgroup.c | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 8f64b459fbd4..d605857c4bf3 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -165,7 +165,7 @@ struct cgroup { | |||
165 | struct list_head files; /* my files */ | 165 | struct list_head files; /* my files */ |
166 | 166 | ||
167 | struct cgroup *parent; /* my parent */ | 167 | struct cgroup *parent; /* my parent */ |
168 | struct dentry __rcu *dentry; /* cgroup fs entry, RCU protected */ | 168 | struct dentry *dentry; /* cgroup fs entry, RCU protected */ |
169 | 169 | ||
170 | /* Private pointers for each registered subsystem */ | 170 | /* Private pointers for each registered subsystem */ |
171 | struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; | 171 | struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; |
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index d62a529db2f7..affc76d7f739 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -1756,9 +1756,11 @@ static struct kobject *cgroup_kobj; | |||
1756 | */ | 1756 | */ |
1757 | int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen) | 1757 | int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen) |
1758 | { | 1758 | { |
1759 | struct dentry *dentry = cgrp->dentry; | ||
1759 | char *start; | 1760 | char *start; |
1760 | struct dentry *dentry = rcu_dereference_check(cgrp->dentry, | 1761 | |
1761 | cgroup_lock_is_held()); | 1762 | rcu_lockdep_assert(rcu_read_lock_held() || cgroup_lock_is_held(), |
1763 | "cgroup_path() called without proper locking"); | ||
1762 | 1764 | ||
1763 | if (!dentry || cgrp == dummytop) { | 1765 | if (!dentry || cgrp == dummytop) { |
1764 | /* | 1766 | /* |
@@ -1782,8 +1784,7 @@ int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen) | |||
1782 | if (!cgrp) | 1784 | if (!cgrp) |
1783 | break; | 1785 | break; |
1784 | 1786 | ||
1785 | dentry = rcu_dereference_check(cgrp->dentry, | 1787 | dentry = cgrp->dentry; |
1786 | cgroup_lock_is_held()); | ||
1787 | if (!cgrp->parent) | 1788 | if (!cgrp->parent) |
1788 | continue; | 1789 | continue; |
1789 | if (--start < buf) | 1790 | if (--start < buf) |
@@ -4124,7 +4125,7 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry, | |||
4124 | 4125 | ||
4125 | /* allocation complete, commit to creation */ | 4126 | /* allocation complete, commit to creation */ |
4126 | dentry->d_fsdata = cgrp; | 4127 | dentry->d_fsdata = cgrp; |
4127 | rcu_assign_pointer(cgrp->dentry, dentry); | 4128 | cgrp->dentry = dentry; |
4128 | list_add_tail(&cgrp->allcg_node, &root->allcg_list); | 4129 | list_add_tail(&cgrp->allcg_node, &root->allcg_list); |
4129 | list_add_tail_rcu(&cgrp->sibling, &cgrp->parent->children); | 4130 | list_add_tail_rcu(&cgrp->sibling, &cgrp->parent->children); |
4130 | root->number_of_cgroups++; | 4131 | root->number_of_cgroups++; |