aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/cgroup.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index c6e77ef2a0a6..2e9b387971d1 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2769,13 +2769,17 @@ static void cgroup_cfts_commit(struct cgroup_subsys *ss,
2769{ 2769{
2770 LIST_HEAD(pending); 2770 LIST_HEAD(pending);
2771 struct cgroup *cgrp, *n; 2771 struct cgroup *cgrp, *n;
2772 struct super_block *sb = ss->root->sb;
2772 2773
2773 /* %NULL @cfts indicates abort and don't bother if @ss isn't attached */ 2774 /* %NULL @cfts indicates abort and don't bother if @ss isn't attached */
2774 if (cfts && ss->root != &rootnode) { 2775 if (cfts && ss->root != &rootnode &&
2776 atomic_inc_not_zero(&sb->s_active)) {
2775 list_for_each_entry(cgrp, &ss->root->allcg_list, allcg_node) { 2777 list_for_each_entry(cgrp, &ss->root->allcg_list, allcg_node) {
2776 dget(cgrp->dentry); 2778 dget(cgrp->dentry);
2777 list_add_tail(&cgrp->cft_q_node, &pending); 2779 list_add_tail(&cgrp->cft_q_node, &pending);
2778 } 2780 }
2781 } else {
2782 sb = NULL;
2779 } 2783 }
2780 2784
2781 mutex_unlock(&cgroup_mutex); 2785 mutex_unlock(&cgroup_mutex);
@@ -2798,6 +2802,9 @@ static void cgroup_cfts_commit(struct cgroup_subsys *ss,
2798 dput(cgrp->dentry); 2802 dput(cgrp->dentry);
2799 } 2803 }
2800 2804
2805 if (sb)
2806 deactivate_super(sb);
2807
2801 mutex_unlock(&cgroup_cft_mutex); 2808 mutex_unlock(&cgroup_cft_mutex);
2802} 2809}
2803 2810