Skip to content

Commit a1c6d54

Browse files
oleg-nesterovbrauner
authored andcommitted
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 <oleg@redhat.com> Link: https://lore.kernel.org/r/20240202131255.GA26025@redhat.com Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 90f92b6 commit a1c6d54

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

kernel/pid.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,7 @@ void exchange_tids(struct task_struct *left, struct task_struct *right)
396396
void transfer_pid(struct task_struct *old, struct task_struct *new,
397397
enum pid_type type)
398398
{
399-
if (type == PIDTYPE_PID)
400-
new->thread_pid = old->thread_pid;
399+
WARN_ON_ONCE(type == PIDTYPE_PID);
401400
hlist_replace_rcu(&old->pid_links[type], &new->pid_links[type]);
402401
}
403402

0 commit comments

Comments
 (0)