aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/cgroup.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 2097684cf19..b303dfc7dce 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -901,13 +901,10 @@ static void cgroup_diput(struct dentry *dentry, struct inode *inode)
901 mutex_unlock(&cgroup_mutex); 901 mutex_unlock(&cgroup_mutex);
902 902
903 /* 903 /*
904 * We want to drop the active superblock reference from the 904 * Drop the active superblock reference that we took when we
905 * cgroup creation after all the dentry refs are gone - 905 * created the cgroup
906 * kill_sb gets mighty unhappy otherwise. Mark
907 * dentry->d_fsdata with cgroup_diput() to tell
908 * cgroup_d_release() to call deactivate_super().
909 */ 906 */
910 dentry->d_fsdata = cgroup_diput; 907 deactivate_super(cgrp->root->sb);
911 908
912 /* 909 /*
913 * if we're getting rid of the cgroup, refcount should ensure 910 * if we're getting rid of the cgroup, refcount should ensure
@@ -933,13 +930,6 @@ static int cgroup_delete(const struct dentry *d)
933 return 1; 930 return 1;
934} 931}
935 932
936static void cgroup_d_release(struct dentry *dentry)
937{
938 /* did cgroup_diput() tell me to deactivate super? */
939 if (dentry->d_fsdata == cgroup_diput)
940 deactivate_super(dentry->d_sb);
941}
942
943static void remove_dir(struct dentry *d) 933static void remove_dir(struct dentry *d)
944{ 934{
945 struct dentry *parent = dget(d->d_parent); 935 struct dentry *parent = dget(d->d_parent);
@@ -1547,7 +1537,6 @@ static int cgroup_get_rootdir(struct super_block *sb)
1547 static const struct dentry_operations cgroup_dops = { 1537 static const struct dentry_operations cgroup_dops = {
1548 .d_iput = cgroup_diput, 1538 .d_iput = cgroup_diput,
1549 .d_delete = cgroup_delete, 1539 .d_delete = cgroup_delete,
1550 .d_release = cgroup_d_release,
1551 }; 1540 };
1552 1541
1553 struct inode *inode = 1542 struct inode *inode =
@@ -3894,8 +3883,12 @@ static void css_dput_fn(struct work_struct *work)
3894{ 3883{
3895 struct cgroup_subsys_state *css = 3884 struct cgroup_subsys_state *css =
3896 container_of(work, struct cgroup_subsys_state, dput_work); 3885 container_of(work, struct cgroup_subsys_state, dput_work);
3886 struct dentry *dentry = css->cgroup->dentry;
3887 struct super_block *sb = dentry->d_sb;
3897 3888
3898 dput(css->cgroup->dentry); 3889 atomic_inc(&sb->s_active);
3890 dput(dentry);
3891 deactivate_super(sb);
3899} 3892}
3900 3893
3901static void init_cgroup_css(struct cgroup_subsys_state *css, 3894static void init_cgroup_css(struct cgroup_subsys_state *css,