Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

remove the no longer needed pid_alive() check in __task_pid_nr_ns()

Starting from 2c4704756cab ("pids: Move the pgrp and session pid pointers
from task_struct to signal_struct") __task_pid_nr_ns() doesn't dereference
task->group_leader, we can remove the pid_alive() check.

pid_nr_ns() has to check pid != NULL anyway, pid_alive() just adds the
unnecessary confusion.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>

authored by

Oleg Nesterov and committed by
Eric W. Biederman
1dd694a1 06576edd

+1 -2
+1 -2
kernel/pid.c
··· 495 495 rcu_read_lock(); 496 496 if (!ns) 497 497 ns = task_active_pid_ns(current); 498 - if (likely(pid_alive(task))) 499 - nr = pid_nr_ns(rcu_dereference(*task_pid_ptr(task, type)), ns); 498 + nr = pid_nr_ns(rcu_dereference(*task_pid_ptr(task, type)), ns); 500 499 rcu_read_unlock(); 501 500 502 501 return nr;