|
@@ -2472,10 +2472,7 @@ static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry)
|
|
mutex_unlock(&cgroup_mutex);
|
|
mutex_unlock(&cgroup_mutex);
|
|
return -EBUSY;
|
|
return -EBUSY;
|
|
}
|
|
}
|
|
-
|
|
|
|
- parent = cgrp->parent;
|
|
|
|
- root = cgrp->root;
|
|
|
|
- sb = root->sb;
|
|
|
|
|
|
+ mutex_unlock(&cgroup_mutex);
|
|
|
|
|
|
/*
|
|
/*
|
|
* Call pre_destroy handlers of subsys. Notify subsystems
|
|
* Call pre_destroy handlers of subsys. Notify subsystems
|
|
@@ -2483,7 +2480,14 @@ static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry)
|
|
*/
|
|
*/
|
|
cgroup_call_pre_destroy(cgrp);
|
|
cgroup_call_pre_destroy(cgrp);
|
|
|
|
|
|
- if (cgroup_has_css_refs(cgrp)) {
|
|
|
|
|
|
+ mutex_lock(&cgroup_mutex);
|
|
|
|
+ parent = cgrp->parent;
|
|
|
|
+ root = cgrp->root;
|
|
|
|
+ sb = root->sb;
|
|
|
|
+
|
|
|
|
+ if (atomic_read(&cgrp->count)
|
|
|
|
+ || !list_empty(&cgrp->children)
|
|
|
|
+ || cgroup_has_css_refs(cgrp)) {
|
|
mutex_unlock(&cgroup_mutex);
|
|
mutex_unlock(&cgroup_mutex);
|
|
return -EBUSY;
|
|
return -EBUSY;
|
|
}
|
|
}
|