Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40514
b: refs/heads/master
c: 4a279ff
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Oct 31, 2006
1 parent ce7d61d commit 00f6ca9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 525fdb6cc929b515ad7e0be40fd023cff8660ed8
refs/heads/master: 4a279ff1ea1cf325775ada983035123fcdc8e986
17 changes: 10 additions & 7 deletions trunk/kernel/taskstats.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,19 +455,25 @@ void taskstats_exit_send(struct task_struct *tsk, struct taskstats *tidstats,
int is_thread_group;
struct nlattr *na;

if (!family_registered || !tidstats)
if (!family_registered)
return;

rc = 0;
/*
* Size includes space for nested attributes
*/
size = nla_total_size(sizeof(u32)) +
nla_total_size(sizeof(struct taskstats)) + nla_total_size(0);

is_thread_group = (tsk->signal->stats != NULL);
if (is_thread_group)
size = 2 * size; /* PID + STATS + TGID + STATS */
if (is_thread_group) {
/* PID + STATS + TGID + STATS */
size = 2 * size;
/* fill the tsk->signal->stats structure */
fill_tgid_exit(tsk);
}

if (!tidstats)
return;

rc = prepare_reply(NULL, TASKSTATS_CMD_NEW, &rep_skb, &reply, size);
if (rc < 0)
Expand All @@ -487,11 +493,8 @@ void taskstats_exit_send(struct task_struct *tsk, struct taskstats *tidstats,
goto send;

/*
* tsk has/had a thread group so fill the tsk->signal->stats structure
* Doesn't matter if tsk is the leader or the last group member leaving
*/

fill_tgid_exit(tsk);
if (!group_dead)
goto send;

Expand Down

0 comments on commit 00f6ca9

Please sign in to comment.