summaryrefslogtreecommitdiff
path: root/kernel/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/signal.c')
-rw-r--r--kernel/signal.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index f65403da4101..f799a054f292 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -268,6 +268,10 @@ void task_clear_group_stop_pending(struct task_struct *task)
*
* CONTEXT:
* Must be called with @task->sighand->siglock held.
+ *
+ * RETURNS:
+ * %true if group stop completion should be notified to the parent, %false
+ * otherwise.
*/
static bool task_participate_group_stop(struct task_struct *task)
{
@@ -284,7 +288,11 @@ static bool task_participate_group_stop(struct task_struct *task)
if (!WARN_ON_ONCE(sig->group_stop_count == 0))
sig->group_stop_count--;
- if (!sig->group_stop_count) {
+ /*
+ * Tell the caller to notify completion iff we are entering into a
+ * fresh group stop. Read comment in do_signal_stop() for details.
+ */
+ if (!sig->group_stop_count && !(sig->flags & SIGNAL_STOP_STOPPED)) {
sig->flags = SIGNAL_STOP_STOPPED;
return true;
}