diff options
-rw-r--r-- | kernel/cgroup.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 48348dde6d81..891a84eb9d30 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -2945,7 +2945,11 @@ int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys, | |||
2945 | parent = task_cgroup(tsk, subsys->subsys_id); | 2945 | parent = task_cgroup(tsk, subsys->subsys_id); |
2946 | 2946 | ||
2947 | /* Pin the hierarchy */ | 2947 | /* Pin the hierarchy */ |
2948 | atomic_inc(&parent->root->sb->s_active); | 2948 | if (!atomic_inc_not_zero(&parent->root->sb->s_active)) { |
2949 | /* We race with the final deactivate_super() */ | ||
2950 | mutex_unlock(&cgroup_mutex); | ||
2951 | return 0; | ||
2952 | } | ||
2949 | 2953 | ||
2950 | /* Keep the cgroup alive */ | 2954 | /* Keep the cgroup alive */ |
2951 | get_css_set(cg); | 2955 | get_css_set(cg); |