diff options
| author | Jeff Garzik <jeff@garzik.org> | 2006-04-12 16:54:16 -0400 |
|---|---|---|
| committer | Jeff Garzik <jeff@garzik.org> | 2006-04-12 16:54:16 -0400 |
| commit | 875999c5539999f61a45620aae0c3e5fb1d2b035 (patch) | |
| tree | 4535032a8a10f5782c0aef6a620b1a624ea9f863 /fs/exec.c | |
| parent | 79072f38909e3d9883317238887460c39ddcc4cb (diff) | |
| parent | 26ec634c31a11a003040e10b4d650495158632fd (diff) | |
Merge branch 'upstream'
Diffstat (limited to 'fs/exec.c')
| -rw-r--r-- | fs/exec.c | 21 |
1 files changed, 19 insertions, 2 deletions
| @@ -561,7 +561,7 @@ static int exec_mmap(struct mm_struct *mm) | |||
| 561 | arch_pick_mmap_layout(mm); | 561 | arch_pick_mmap_layout(mm); |
| 562 | if (old_mm) { | 562 | if (old_mm) { |
| 563 | up_read(&old_mm->mmap_sem); | 563 | up_read(&old_mm->mmap_sem); |
| 564 | if (active_mm != old_mm) BUG(); | 564 | BUG_ON(active_mm != old_mm); |
| 565 | mmput(old_mm); | 565 | mmput(old_mm); |
| 566 | return 0; | 566 | return 0; |
| 567 | } | 567 | } |
| @@ -678,6 +678,18 @@ static int de_thread(struct task_struct *tsk) | |||
| 678 | while (leader->exit_state != EXIT_ZOMBIE) | 678 | while (leader->exit_state != EXIT_ZOMBIE) |
| 679 | yield(); | 679 | yield(); |
| 680 | 680 | ||
| 681 | /* | ||
| 682 | * The only record we have of the real-time age of a | ||
| 683 | * process, regardless of execs it's done, is start_time. | ||
| 684 | * All the past CPU time is accumulated in signal_struct | ||
| 685 | * from sister threads now dead. But in this non-leader | ||
| 686 | * exec, nothing survives from the original leader thread, | ||
| 687 | * whose birth marks the true age of this process now. | ||
| 688 | * When we take on its identity by switching to its PID, we | ||
| 689 | * also take its birthdate (always earlier than our own). | ||
| 690 | */ | ||
| 691 | current->start_time = leader->start_time; | ||
| 692 | |||
| 681 | spin_lock(&leader->proc_lock); | 693 | spin_lock(&leader->proc_lock); |
| 682 | spin_lock(¤t->proc_lock); | 694 | spin_lock(¤t->proc_lock); |
| 683 | proc_dentry1 = proc_pid_unhash(current); | 695 | proc_dentry1 = proc_pid_unhash(current); |
| @@ -723,7 +735,12 @@ static int de_thread(struct task_struct *tsk) | |||
| 723 | current->parent = current->real_parent = leader->real_parent; | 735 | current->parent = current->real_parent = leader->real_parent; |
| 724 | leader->parent = leader->real_parent = child_reaper; | 736 | leader->parent = leader->real_parent = child_reaper; |
| 725 | current->group_leader = current; | 737 | current->group_leader = current; |
| 726 | leader->group_leader = leader; | 738 | leader->group_leader = current; |
| 739 | |||
| 740 | /* Reduce leader to a thread */ | ||
| 741 | detach_pid(leader, PIDTYPE_PGID); | ||
| 742 | detach_pid(leader, PIDTYPE_SID); | ||
| 743 | list_del_init(&leader->tasks); | ||
| 727 | 744 | ||
| 728 | add_parent(current); | 745 | add_parent(current); |
| 729 | add_parent(leader); | 746 | add_parent(leader); |
