From 59978bf02691a64008d045c898c870df550dfe41 Mon Sep 17 00:00:00 2001 From: Li Zefan Date: Sun, 4 Jan 2009 12:00:45 -0800 Subject: [PATCH] --- yaml --- r: 125728 b: refs/heads/master c: 7b574b7b0124ed344911f5d581e9bc2d83bbeb19 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/kernel/cgroup.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index dc4ffdd9cbae..91ecaf25ddc7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7d3b56ba37a95f1f370f50258ed3954c304c524b +refs/heads/master: 7b574b7b0124ed344911f5d581e9bc2d83bbeb19 diff --git a/trunk/kernel/cgroup.c b/trunk/kernel/cgroup.c index 48348dde6d81..891a84eb9d30 100644 --- a/trunk/kernel/cgroup.c +++ b/trunk/kernel/cgroup.c @@ -2945,7 +2945,11 @@ int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys, parent = task_cgroup(tsk, subsys->subsys_id); /* 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 */ get_css_set(cg);