|
@@ -2945,7 +2945,11 @@ int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys,
|
|
parent = task_cgroup(tsk, subsys->subsys_id);
|
|
parent = task_cgroup(tsk, subsys->subsys_id);
|
|
|
|
|
|
/* Pin the hierarchy */
|
|
/* Pin the hierarchy */
|
|
- atomic_inc(&parent->root->sb->s_active);
|
|
|
|
|
|
+ if (!atomic_inc_not_zero(&parent->root->sb->s_active)) {
|
|
|
|
+ /* We race with the final deactivate_super() */
|
|
|
|
+ mutex_unlock(&cgroup_mutex);
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
|
|
/* Keep the cgroup alive */
|
|
/* Keep the cgroup alive */
|
|
get_css_set(cg);
|
|
get_css_set(cg);
|