kernfs_break_active_protection(of->kn);
mutex_lock(&cgroup_tree_mutex);
+ if (!cgroup_lock_live_group(cgrp)) {
+ ret = -ENODEV;
+ goto out_unlock_tree;
+ }
for_each_subsys(ss, ssid) {
if (enable & (1 << ssid)) {
cgroup_get(child);
prepare_to_wait(&child->offline_waitq, &wait,
TASK_UNINTERRUPTIBLE);
+ mutex_unlock(&cgroup_mutex);
mutex_unlock(&cgroup_tree_mutex);
schedule();
finish_wait(&child->offline_waitq, &wait);
(cgrp->parent &&
!(cgrp->parent->child_subsys_mask & (1 << ssid)))) {
ret = -ENOENT;
- goto out_unlock_tree;
+ goto out_unlock;
}
} else if (disable & (1 << ssid)) {
if (!(cgrp->child_subsys_mask & (1 << ssid))) {
cgroup_for_each_live_child(child, cgrp) {
if (child->child_subsys_mask & (1 << ssid)) {
ret = -EBUSY;
- goto out_unlock_tree;
+ goto out_unlock;
}
}
}
if (!enable && !disable) {
ret = 0;
- goto out_unlock_tree;
- }
-
- if (!cgroup_lock_live_group(cgrp)) {
- ret = -ENODEV;
- goto out_unlock_tree;
+ goto out_unlock;
}
/*