Skip to contentSkip to conversation

coredump: copy_process: don't check SIGNAL_GROUP_EXIT

PATCH In review Oleg Nesterov 2 participants 2 messages Apr 8, 2006 – Apr 10, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 3/3 coredump: copy_process: don't check SIGNAL_GROUP_EXIT

After the previous patch SIGNAL_GROUP_EXIT implies a pending SIGKILL, we can remove this check from copy_process() because we already checked !signal_pending().

kernel/fork.c renamed from kernel/fork.c~3_fork +0 -12
@@ -1157,18 +1157,6 @@ static task_t *copy_process(unsigned lon
 	}
 
 	if (clone_flags & CLONE_THREAD) {
-		/*
-		 * Important: if an exit-all has been started then
-		 * do not create this new thread - the whole thread
-		 * group is supposed to exit anyway.
-		 */
-		if (current->signal->flags & SIGNAL_GROUP_EXIT) {
-			spin_unlock(&current->sighand->siglock);
-			write_unlock_irq(&tasklist_lock);
-			retval = -EAGAIN;
-			goto bad_fork_cleanup_namespace;
-		}
-
 		p->group_leader = current->group_leader;
 		list_add_tail_rcu(&p->thread_group, &p->group_leader->thread_group);
 
#1 lore raw
Quoted 3 lines

After the previous patch SIGNAL_GROUP_EXIT implies a pending SIGKILL, we can remove this check from copy_process() because we already checked !signal_pending().

My SIGNAL_GROUP_EXEC change made this spot check for either flag, but this already holds true for the exec case and so my change to this check here was not needed. With the coredump change done, I concur that the exit cases are covered too and so this check can go. For paranoia's sake, perhaps we should leave behind a BUG_ON.

Thanks,
Roland