Skip to content

Commit b1afcad

Browse files
oleg-nesterovbrauner
authored andcommitted
pid: change bacct_add_tsk() to use task_ppid_nr_ns()
to simplify the code. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Link: https://lore.kernel.org/20250810173615.GA20000@redhat.com Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent abdfd49 commit b1afcad

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

kernel/tsacct.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,11 @@ void bacct_add_tsk(struct user_namespace *user_ns,
5757
stats->ac_sched = tsk->policy;
5858
stats->ac_pid = task_pid_nr_ns(tsk, pid_ns);
5959
stats->ac_tgid = task_tgid_nr_ns(tsk, pid_ns);
60+
stats->ac_ppid = task_ppid_nr_ns(tsk, pid_ns);
6061
rcu_read_lock();
6162
tcred = __task_cred(tsk);
6263
stats->ac_uid = from_kuid_munged(user_ns, tcred->uid);
6364
stats->ac_gid = from_kgid_munged(user_ns, tcred->gid);
64-
stats->ac_ppid = pid_alive(tsk) ?
65-
task_tgid_nr_ns(rcu_dereference(tsk->real_parent), pid_ns) : 0;
6665
rcu_read_unlock();
6766

6867
task_cputime(tsk, &utime, &stime);

0 commit comments

Comments
 (0)