Skip to content

Commit

Permalink
pid: kill the obsolete PIDTYPE_PID code in transfer_pid()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
oleg-nesterov authored and brauner committed Feb 2, 2024
1 parent 90f92b6 commit a1c6d54
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kernel/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}

Expand Down

0 comments on commit a1c6d54

Please sign in to comment.