aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/cgroup.h1
-rw-r--r--kernel/cgroup.c8
2 files changed, 3 insertions, 6 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 08eb71ee600b..aa7353deaaf3 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -177,7 +177,6 @@ struct cgroup {
177 177
178 struct cgroup *parent; /* my parent */ 178 struct cgroup *parent; /* my parent */
179 struct kernfs_node *kn; /* cgroup kernfs entry */ 179 struct kernfs_node *kn; /* cgroup kernfs entry */
180 struct kernfs_node *control_kn; /* kn for "cgroup.subtree_control" */
181 struct kernfs_node *populated_kn; /* kn for "cgroup.subtree_populated" */ 180 struct kernfs_node *populated_kn; /* kn for "cgroup.subtree_populated" */
182 181
183 /* 182 /*
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 9a48c117ebf1..94d259bcd2b9 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2580,7 +2580,7 @@ static ssize_t cgroup_subtree_control_write(struct kernfs_open_file *of,
2580 * active_ref protection. 2580 * active_ref protection.
2581 */ 2581 */
2582 cgroup_get(cgrp); 2582 cgroup_get(cgrp);
2583 kernfs_break_active_protection(cgrp->control_kn); 2583 kernfs_break_active_protection(of->kn);
2584 2584
2585 mutex_lock(&cgroup_tree_mutex); 2585 mutex_lock(&cgroup_tree_mutex);
2586 2586
@@ -2697,7 +2697,7 @@ out_unlock:
2697out_unlock_tree: 2697out_unlock_tree:
2698 mutex_unlock(&cgroup_tree_mutex); 2698 mutex_unlock(&cgroup_tree_mutex);
2699out_unbreak: 2699out_unbreak:
2700 kernfs_unbreak_active_protection(cgrp->control_kn); 2700 kernfs_unbreak_active_protection(of->kn);
2701 cgroup_put(cgrp); 2701 cgroup_put(cgrp);
2702 return ret ?: nbytes; 2702 return ret ?: nbytes;
2703 2703
@@ -2887,9 +2887,7 @@ static int cgroup_add_file(struct cgroup *cgrp, struct cftype *cft)
2887 return ret; 2887 return ret;
2888 } 2888 }
2889 2889
2890 if (cft->seq_show == cgroup_subtree_control_show) 2890 if (cft->seq_show == cgroup_populated_show)
2891 cgrp->control_kn = kn;
2892 else if (cft->seq_show == cgroup_populated_show)
2893 cgrp->populated_kn = kn; 2891 cgrp->populated_kn = kn;
2894 return 0; 2892 return 0;
2895} 2893}