Skip to content

Commit 2515ddc

Browse files
pmundttorvalds
authored andcommitted
binfmt_elf_fdpic: Update for cputime changes.
Commit f06febc ("timers: fix itimer/ many thread hang") introduced a new task_cputime interface and subsequently only converted binfmt_elf over to it. This results in the build for binfmt_elf_fdpic blowing up given that p->signal->{u,s}time have disappeared from underneath us. Apply the same trivial fix from binfmt_elf to binfmt_elf_fdpic. Signed-off-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent a50c22e commit 2515ddc

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

‎fs/binfmt_elf_fdpic.c‎

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,20 +1390,15 @@ static void fill_prstatus(struct elf_prstatus *prstatus,
13901390
prstatus->pr_pgrp = task_pgrp_vnr(p);
13911391
prstatus->pr_sid = task_session_vnr(p);
13921392
if (thread_group_leader(p)) {
1393+
struct task_cputime cputime;
1394+
13931395
/*
1394-
* This is the record for the group leader. Add in the
1395-
* cumulative times of previous dead threads. This total
1396-
* won't include the time of each live thread whose state
1397-
* is included in the core dump. The final total reported
1398-
* to our parent process when it calls wait4 will include
1399-
* those sums as well as the little bit more time it takes
1400-
* this and each other thread to finish dying after the
1401-
* core dump synchronization phase.
1396+
* This is the record for the group leader. It shows the
1397+
* group-wide total, not its individual thread total.
14021398
*/
1403-
cputime_to_timeval(cputime_add(p->utime, p->signal->utime),
1404-
&prstatus->pr_utime);
1405-
cputime_to_timeval(cputime_add(p->stime, p->signal->stime),
1406-
&prstatus->pr_stime);
1399+
thread_group_cputime(p, &cputime);
1400+
cputime_to_timeval(cputime.utime, &prstatus->pr_utime);
1401+
cputime_to_timeval(cputime.stime, &prstatus->pr_stime);
14071402
} else {
14081403
cputime_to_timeval(p->utime, &prstatus->pr_utime);
14091404
cputime_to_timeval(p->stime, &prstatus->pr_stime);

0 commit comments

Comments
 (0)