Commit c2a0f5943d8935766a42b2d0870aa4c645e3423d
1 parent
c83d9945c0
Exists in
master
and in
39 other branches
Clean up subthread exec
Make sure we re-parent itimers, and use BUG_ON() instead of an explicit conditional BUG().
Showing 1 changed file with 6 additions and 10 deletions Side-by-side Diff
fs/exec.c
... | ... | @@ -649,6 +649,7 @@ |
649 | 649 | } |
650 | 650 | sig->group_exit_task = NULL; |
651 | 651 | sig->notify_count = 0; |
652 | + sig->real_timer.data = (unsigned long)current; | |
652 | 653 | spin_unlock_irq(lock); |
653 | 654 | |
654 | 655 | /* |
... | ... | @@ -675,10 +676,8 @@ |
675 | 676 | proc_dentry2 = proc_pid_unhash(leader); |
676 | 677 | write_lock_irq(&tasklist_lock); |
677 | 678 | |
678 | - if (leader->tgid != current->tgid) | |
679 | - BUG(); | |
680 | - if (current->pid == current->tgid) | |
681 | - BUG(); | |
679 | + BUG_ON(leader->tgid != current->tgid); | |
680 | + BUG_ON(current->pid == current->tgid); | |
682 | 681 | /* |
683 | 682 | * An exec() starts a new thread group with the |
684 | 683 | * TGID of the previous thread group. Rehash the |
... | ... | @@ -726,8 +725,7 @@ |
726 | 725 | proc_pid_flush(proc_dentry1); |
727 | 726 | proc_pid_flush(proc_dentry2); |
728 | 727 | |
729 | - if (exit_state != EXIT_ZOMBIE) | |
730 | - BUG(); | |
728 | + BUG_ON(exit_state != EXIT_ZOMBIE); | |
731 | 729 | release_task(leader); |
732 | 730 | } |
733 | 731 | |
... | ... | @@ -772,10 +770,8 @@ |
772 | 770 | kmem_cache_free(sighand_cachep, oldsighand); |
773 | 771 | } |
774 | 772 | |
775 | - if (!thread_group_empty(current)) | |
776 | - BUG(); | |
777 | - if (!thread_group_leader(current)) | |
778 | - BUG(); | |
773 | + BUG_ON(!thread_group_empty(current)); | |
774 | + BUG_ON(!thread_group_leader(current)); | |
779 | 775 | return 0; |
780 | 776 | } |
781 | 777 |