diff options
author | Li Zefan <lizefan@huawei.com> | 2014-03-28 15:18:27 +0800 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-03-29 09:15:53 -0400 |
commit | e8604cb43690b781f9a7ad4a770f3e10259fe939 (patch) | |
tree | 0feff5f9e9efe957a6f74a2cb23dc753428d87de /kernel/fork.c | |
parent | 01a971406177c2ca9834be6914a67e20f463a3e6 (diff) | |
download | lwn-e8604cb43690b781f9a7ad4a770f3e10259fe939.tar.gz lwn-e8604cb43690b781f9a7ad4a770f3e10259fe939.zip |
cgroup: fix spurious lockdep warning in cgroup_exit()
cgroup_exit() is called in fork and exit path. If it's called in the
failure path during fork, PF_EXITING isn't set, and then lockdep will
complain.
Fix this by removing cgroup_exit() in that failure path. cgroup_fork()
does nothing that needs cleanup.
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index a17621c6cd42..8852b3463ab7 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1271,7 +1271,7 @@ static struct task_struct *copy_process(unsigned long clone_flags, if (IS_ERR(p->mempolicy)) { retval = PTR_ERR(p->mempolicy); p->mempolicy = NULL; - goto bad_fork_cleanup_cgroup; + goto bad_fork_cleanup_threadgroup_lock; } mpol_fix_fork_child_flag(p); #endif @@ -1524,11 +1524,10 @@ bad_fork_cleanup_policy: perf_event_free_task(p); #ifdef CONFIG_NUMA mpol_put(p->mempolicy); -bad_fork_cleanup_cgroup: +bad_fork_cleanup_threadgroup_lock: #endif if (clone_flags & CLONE_THREAD) threadgroup_change_end(current); - cgroup_exit(p, 0); delayacct_tsk_free(p); module_put(task_thread_info(p)->exec_domain->module); bad_fork_cleanup_count: |