aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/exec.c11
-rw-r--r--kernel/exit.c2
2 files changed, 6 insertions, 7 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 0c72d23ed0e2..e19de6a80339 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -768,7 +768,6 @@ static int de_thread(struct task_struct *tsk)
768 struct signal_struct *sig = tsk->signal; 768 struct signal_struct *sig = tsk->signal;
769 struct sighand_struct *oldsighand = tsk->sighand; 769 struct sighand_struct *oldsighand = tsk->sighand;
770 spinlock_t *lock = &oldsighand->siglock; 770 spinlock_t *lock = &oldsighand->siglock;
771 int count;
772 771
773 if (thread_group_empty(tsk)) 772 if (thread_group_empty(tsk))
774 goto no_thread_group; 773 goto no_thread_group;
@@ -785,13 +784,13 @@ static int de_thread(struct task_struct *tsk)
785 spin_unlock_irq(lock); 784 spin_unlock_irq(lock);
786 return -EAGAIN; 785 return -EAGAIN;
787 } 786 }
787
788 sig->group_exit_task = tsk; 788 sig->group_exit_task = tsk;
789 zap_other_threads(tsk); 789 sig->notify_count = zap_other_threads(tsk);
790 if (!thread_group_leader(tsk))
791 sig->notify_count--;
790 792
791 /* Account for the thread group leader hanging around: */ 793 while (sig->notify_count) {
792 count = thread_group_leader(tsk) ? 1 : 2;
793 sig->notify_count = count;
794 while (atomic_read(&sig->count) > count) {
795 __set_current_state(TASK_UNINTERRUPTIBLE); 794 __set_current_state(TASK_UNINTERRUPTIBLE);
796 spin_unlock_irq(lock); 795 spin_unlock_irq(lock);
797 schedule(); 796 schedule();
diff --git a/kernel/exit.c b/kernel/exit.c
index 59a104c673f7..9220967f4256 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -97,7 +97,7 @@ static void __exit_signal(struct task_struct *tsk)
97 * If there is any task waiting for the group exit 97 * If there is any task waiting for the group exit
98 * then notify it: 98 * then notify it:
99 */ 99 */
100 if (sig->group_exit_task && atomic_read(&sig->count) == sig->notify_count) 100 if (sig->notify_count > 0 && !--sig->notify_count)
101 wake_up_process(sig->group_exit_task); 101 wake_up_process(sig->group_exit_task);
102 102
103 if (tsk == sig->curr_target) 103 if (tsk == sig->curr_target)