aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorLi Zefan <lizefan@huawei.com>2014-03-28 03:18:27 -0400
committerTejun Heo <tj@kernel.org>2014-03-29 09:15:53 -0400
commite8604cb43690b781f9a7ad4a770f3e10259fe939 (patch)
tree0feff5f9e9efe957a6f74a2cb23dc753428d87de /kernel/fork.c
parent01a971406177c2ca9834be6914a67e20f463a3e6 (diff)
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.c5
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,
1271 if (IS_ERR(p->mempolicy)) { 1271 if (IS_ERR(p->mempolicy)) {
1272 retval = PTR_ERR(p->mempolicy); 1272 retval = PTR_ERR(p->mempolicy);
1273 p->mempolicy = NULL; 1273 p->mempolicy = NULL;
1274 goto bad_fork_cleanup_cgroup; 1274 goto bad_fork_cleanup_threadgroup_lock;
1275 } 1275 }
1276 mpol_fix_fork_child_flag(p); 1276 mpol_fix_fork_child_flag(p);
1277#endif 1277#endif
@@ -1524,11 +1524,10 @@ bad_fork_cleanup_policy:
1524 perf_event_free_task(p); 1524 perf_event_free_task(p);
1525#ifdef CONFIG_NUMA 1525#ifdef CONFIG_NUMA
1526 mpol_put(p->mempolicy); 1526 mpol_put(p->mempolicy);
1527bad_fork_cleanup_cgroup: 1527bad_fork_cleanup_threadgroup_lock:
1528#endif 1528#endif
1529 if (clone_flags & CLONE_THREAD) 1529 if (clone_flags & CLONE_THREAD)
1530 threadgroup_change_end(current); 1530 threadgroup_change_end(current);
1531 cgroup_exit(p, 0);
1532 delayacct_tsk_free(p); 1531 delayacct_tsk_free(p);
1533 module_put(task_thread_info(p)->exec_domain->module); 1532 module_put(task_thread_info(p)->exec_domain->module);
1534bad_fork_cleanup_count: 1533bad_fork_cleanup_count: