I just fixed a bug in copy_process when using the label bad_fork_cleanup_threadgroup_lock. While fixing the bug I looked closer at the label and realized it has been misnamed since 568ac888215c ("cgroup: reduce read locked section of cgroup_threadgroup_rwsem during fork"). Fix the name so that fork is easier to understand.
Unified · Split
| @@ -2120,14 +2120,14 @@ static __latent_entropy struct task_struct *copy_process( · 2119 unmodified lines | |||
| 2120 | cgroup_fork(p); | 2120 | cgroup_fork(p); |
| 2121 | if (p->flags & PF_KTHREAD) { | 2121 | if (p->flags & PF_KTHREAD) { |
| 2122 | if (!set_kthread_struct(p)) | 2122 | if (!set_kthread_struct(p)) |
| 2123 | goto bad_fork_cleanup_threadgroup_lock; | 2123 | goto bad_fork_cleanup_delayacct; |
| 2124 | } | 2124 | } |
| 2125 | #ifdef CONFIG_NUMA | 2125 | #ifdef CONFIG_NUMA |
| 2126 | p->mempolicy = mpol_dup(p->mempolicy); | 2126 | p->mempolicy = mpol_dup(p->mempolicy); |
| 2127 | if (IS_ERR(p->mempolicy)) { | 2127 | if (IS_ERR(p->mempolicy)) { |
| 2128 | retval = PTR_ERR(p->mempolicy); | 2128 | retval = PTR_ERR(p->mempolicy); |
| 2129 | p->mempolicy = NULL; | 2129 | p->mempolicy = NULL; |
| 2130 | goto bad_fork_cleanup_threadgroup_lock; | 2130 | goto bad_fork_cleanup_delayacct; |
| 2131 | } | 2131 | } |
| 2132 | #endif | 2132 | #endif |
| 2133 | #ifdef CONFIG_CPUSETS | 2133 | #ifdef CONFIG_CPUSETS |
| @@ -2465,7 +2465,7 @@ bad_fork_cleanup_policy: · 331 unmodified lines | |||
| 2465 | #ifdef CONFIG_NUMA | 2465 | #ifdef CONFIG_NUMA |
| 2466 | mpol_put(p->mempolicy); | 2466 | mpol_put(p->mempolicy); |
| 2467 | #endif | 2467 | #endif |
| 2468 | bad_fork_cleanup_threadgroup_lock: | 2468 | bad_fork_cleanup_delayacct: |
| 2469 | delayacct_tsk_free(p); | 2469 | delayacct_tsk_free(p); |
| 2470 | bad_fork_cleanup_count: | 2470 | bad_fork_cleanup_count: |
| 2471 | dec_rlimit_ucounts(task_ucounts(p), UCOUNT_RLIMIT_NPROC, 1); | 2471 | dec_rlimit_ucounts(task_ucounts(p), UCOUNT_RLIMIT_NPROC, 1); |