Commit 7db5b3ca authored by Tejun Heo's avatar Tejun Heo

Revert "cgroup: superblock can't be released with active dentries"

This reverts commit fa980ca8.  The
commit was an attempt to fix a race condition where a cgroup hierarchy
may be unmounted with positive dentry reference on root cgroup.  While
the commit made the race condition slightly more difficult to trigger,
the race was still there and could be reliably triggered using a
different test case.

Revert the incorrect fix.  The next commit will describe the race and
fix it correctly.
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
LKML-Reference: <4FEEA5CB.8070809@huawei.com>
Reported-by: default avatarshyju pv <shyju.pv@huawei.com>
Cc: Sasha Levin <levinsasha928@gmail.com>
Acked-by: default avatarLi Zefan <lizefan@huawei.com>
parent cd6407fe
...@@ -901,13 +901,10 @@ static void cgroup_diput(struct dentry *dentry, struct inode *inode) ...@@ -901,13 +901,10 @@ static void cgroup_diput(struct dentry *dentry, struct inode *inode)
mutex_unlock(&cgroup_mutex); mutex_unlock(&cgroup_mutex);
/* /*
* We want to drop the active superblock reference from the * Drop the active superblock reference that we took when we
* cgroup creation after all the dentry refs are gone - * created the cgroup
* kill_sb gets mighty unhappy otherwise. Mark
* dentry->d_fsdata with cgroup_diput() to tell
* cgroup_d_release() to call deactivate_super().
*/ */
dentry->d_fsdata = cgroup_diput; deactivate_super(cgrp->root->sb);
/* /*
* if we're getting rid of the cgroup, refcount should ensure * if we're getting rid of the cgroup, refcount should ensure
...@@ -933,13 +930,6 @@ static int cgroup_delete(const struct dentry *d) ...@@ -933,13 +930,6 @@ static int cgroup_delete(const struct dentry *d)
return 1; return 1;
} }
static void cgroup_d_release(struct dentry *dentry)
{
/* did cgroup_diput() tell me to deactivate super? */
if (dentry->d_fsdata == cgroup_diput)
deactivate_super(dentry->d_sb);
}
static void remove_dir(struct dentry *d) static void remove_dir(struct dentry *d)
{ {
struct dentry *parent = dget(d->d_parent); struct dentry *parent = dget(d->d_parent);
...@@ -1547,7 +1537,6 @@ static int cgroup_get_rootdir(struct super_block *sb) ...@@ -1547,7 +1537,6 @@ static int cgroup_get_rootdir(struct super_block *sb)
static const struct dentry_operations cgroup_dops = { static const struct dentry_operations cgroup_dops = {
.d_iput = cgroup_diput, .d_iput = cgroup_diput,
.d_delete = cgroup_delete, .d_delete = cgroup_delete,
.d_release = cgroup_d_release,
}; };
struct inode *inode = struct inode *inode =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment