diff options
| author | Oleg Nesterov <[email protected]> | 2024-02-02 14:12:55 +0100 |
|---|---|---|
| committer | Christian Brauner <[email protected]> | 2024-02-02 14:57:53 +0100 |
| commit | a1c6d5439fbddd06aad3ddbb7f12df0b98354070 (patch) | |
| tree | 88c23e0439a837da1d3018d47bbc1bcaf912bbbd | |
| parent | 90f92b68c9869913753f8bc1d87b7762a5f36873 (diff) | |
pid: kill the obsolete PIDTYPE_PID code in transfer_pid()
transfer_pid() must be never called with pid == PIDTYPE_PID,
new_leader->thread_pid should be changed by exchange_tids().
Signed-off-by: Oleg Nesterov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Christian Brauner <[email protected]>
| -rw-r--r-- | kernel/pid.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/pid.c b/kernel/pid.c index 62461c7c82b8..de0bf2f8d18b 100644 --- a/kernel/pid.c +++ b/kernel/pid.c @@ -396,8 +396,7 @@ void exchange_tids(struct task_struct *left, struct task_struct *right) void transfer_pid(struct task_struct *old, struct task_struct *new, enum pid_type type) { - if (type == PIDTYPE_PID) - new->thread_pid = old->thread_pid; + WARN_ON_ONCE(type == PIDTYPE_PID); hlist_replace_rcu(&old->pid_links[type], &new->pid_links[type]); } |