exec: Remove BUG_ON(has_group_leader_pid)
authorEric W. Biederman <ebiederm@xmission.com>
Sun, 26 Apr 2020 12:51:03 +0000 (07:51 -0500)
committerEric W. Biederman <ebiederm@xmission.com>
Tue, 28 Apr 2020 21:50:07 +0000 (16:50 -0500)
With the introduction of exchange_tids thread_group_leader and
has_group_leader_pid have become equivalent.  Further at this point in the
code a thread group has exactly two threads, the previous thread_group_leader
that is waiting to be reaped and tsk.  So we know it is impossible for tsk to
be the thread_group_leader.

This is also the last user of has_group_leader_pid so removing this check
will allow has_group_leader_pid to be removed.

So remove the "BUG_ON(has_group_leader_pid)" that will never fire.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
fs/exec.c

index 9b60f927afd7d14e661593b0e88dd3dc8b25ca10..6ab1c19d84faf74214d11de32e9c729163c47a10 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1176,7 +1176,6 @@ static int de_thread(struct task_struct *tsk)
                tsk->start_boottime = leader->start_boottime;
 
                BUG_ON(!same_thread_group(leader, tsk));
-               BUG_ON(has_group_leader_pid(tsk));
                /*
                 * An exec() starts a new thread group with the
                 * TGID of the previous thread group. Rehash the