mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
remove task_ppid_nr_ns
task_ppid_nr_ns is called in three places. One of these should never have called it. In the other two, using it broke the existing semantics. This was presumably accidental. If the function had not been there, it would have been much more obvious to the eye that those patches were changing the behavior. We don't need this function. In task_state, the pid of the ptracer is not the ppid of the ptracer. In do_task_stat, ppid is the tgid of the real_parent, not its pid. I also moved the call outside of lock_task_sighand, since it doesn't need it. In sys_getppid, ppid is the tgid of the real_parent, not its pid. Signed-off-by: Roland McGrath <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
974a9f0b47
commit
84427eaef1
3 changed files with 3 additions and 16 deletions
|
|
@ -169,7 +169,7 @@ static inline char *task_state(struct task_struct *p, char *buffer)
|
|||
ppid = pid_alive(p) ?
|
||||
task_tgid_nr_ns(rcu_dereference(p->real_parent), ns) : 0;
|
||||
tpid = pid_alive(p) && p->ptrace ?
|
||||
task_ppid_nr_ns(rcu_dereference(p->parent), ns) : 0;
|
||||
task_pid_nr_ns(rcu_dereference(p->parent), ns) : 0;
|
||||
buffer += sprintf(buffer,
|
||||
"State:\t%s\n"
|
||||
"Tgid:\t%d\n"
|
||||
|
|
@ -426,6 +426,7 @@ static int do_task_stat(struct task_struct *task, char *buffer, int whole)
|
|||
cgtime = gtime = cputime_zero;
|
||||
|
||||
rcu_read_lock();
|
||||
ppid = task_tgid_nr_ns(task->real_parent, ns);
|
||||
if (lock_task_sighand(task, &flags)) {
|
||||
struct signal_struct *sig = task->signal;
|
||||
|
||||
|
|
@ -465,7 +466,6 @@ static int do_task_stat(struct task_struct *task, char *buffer, int whole)
|
|||
|
||||
sid = task_session_nr_ns(task, ns);
|
||||
pgid = task_pgrp_nr_ns(task, ns);
|
||||
ppid = task_ppid_nr_ns(task, ns);
|
||||
|
||||
unlock_task_sighand(task, &flags);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue