提交 1dd694a1 编写于 作者: O Oleg Nesterov 提交者: Eric W. Biederman

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

Starting from 2c470475 ("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: NOleg Nesterov <oleg@redhat.com>
Reviewed-by: N"Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: NChristian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
上级 06576edd
...@@ -495,8 +495,7 @@ pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type, ...@@ -495,8 +495,7 @@ pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type,
rcu_read_lock(); rcu_read_lock();
if (!ns) if (!ns)
ns = task_active_pid_ns(current); ns = task_active_pid_ns(current);
if (likely(pid_alive(task))) nr = pid_nr_ns(rcu_dereference(*task_pid_ptr(task, type)), ns);
nr = pid_nr_ns(rcu_dereference(*task_pid_ptr(task, type)), ns);
rcu_read_unlock(); rcu_read_unlock();
return nr; return nr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册