Le Thu, 13 Sep 2007 16:41:41 +0400,
Oleg Nesterov <oleg@tv-sign.ru> a écrit :
Thank you Oleg, hopefully I addressed all your comments in v4.
I documented this in v4, but I was wondering if always setting
tsk->exit_state under the protection of lock_task_sighand() would fix
the race.
Seems like this code was copied from kernel/acct.c:acct_collect():
if (thread_group_leader(current)) {
pacct->ac_exitcode = exitcode;
if (current->flags & PF_FORKNOEXEC)
pacct->ac_flag |= AFORK;
}
From include/linux/acct.h: executed fork, but did not exec
Except that it talks about fork(2), not do_fork() hence the
thread_group_leader() test to avoid flagging threads.
I put ->signal->group_exit_code if not null, otherwise
leader->exit_code.
Thank again to you and Andrew for the review.
--
Guillaume
-