aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2008-02-08 07:19:19 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 12:22:29 -0500
commitfea9d175545b38cb3e84569400419eb81bc90fa3 (patch)
tree0d43fe9ed2ea6104ee8b15a3eb8da081dd08fd35 /fs
parent46f382d2b69d2221086b823f0dbc8f32c027cac2 (diff)
ITIMER_REAL: convert to use struct pid
signal_struct->tsk points to the ->group_leader and thus we have the nasty code in de_thread() which has to change it and restart ->real_timer if the leader is changed. Use "struct pid *leader_pid" instead. This also allows us to kill now unneeded send_group_sig_info(). Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Acked-by: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Davide Libenzi <davidel@xmailserver.org> Cc: Pavel Emelyanov <xemul@openvz.org> Acked-by: Roland McGrath <roland@redhat.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/exec.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/fs/exec.c b/fs/exec.c
index be923e4bc389..927a7c5ef4af 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -782,26 +782,8 @@ static int de_thread(struct task_struct *tsk)
782 zap_other_threads(tsk); 782 zap_other_threads(tsk);
783 read_unlock(&tasklist_lock); 783 read_unlock(&tasklist_lock);
784 784
785 /* 785 /* Account for the thread group leader hanging around: */
786 * Account for the thread group leader hanging around: 786 count = thread_group_leader(tsk) ? 1 : 2;
787 */
788 count = 1;
789 if (!thread_group_leader(tsk)) {
790 count = 2;
791 /*
792 * The SIGALRM timer survives the exec, but needs to point
793 * at us as the new group leader now. We have a race with
794 * a timer firing now getting the old leader, so we need to
795 * synchronize with any firing (by calling del_timer_sync)
796 * before we can safely let the old group leader die.
797 */
798 sig->tsk = tsk;
799 spin_unlock_irq(lock);
800 if (hrtimer_cancel(&sig->real_timer))
801 hrtimer_restart(&sig->real_timer);
802 spin_lock_irq(lock);
803 }
804
805 sig->notify_count = count; 787 sig->notify_count = count;
806 while (atomic_read(&sig->count) > count) { 788 while (atomic_read(&sig->count) > count) {
807 __set_current_state(TASK_UNINTERRUPTIBLE); 789 __set_current_state(TASK_UNINTERRUPTIBLE);