summaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-05-07 02:55:41 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-05-07 02:55:41 +0000
commitdcec8a13bf565e47942a1751a9cec21bec5648fe (patch)
tree548b69625b18cc2e88c3e68d0923be546c9ebb03 /kernel/fork.c
parent2e0f55e79c49509b7ff70ff1a10e1e9e90a3dfd4 (diff)
o Merge with Linux 2.1.99.
o Fix ancient bug in the ELF loader making ldd crash. o Fix ancient bug in the keyboard code for SGI, SNI and Jazz.
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index a08aa2c64..88199cae1 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -208,6 +208,7 @@ static inline int dup_mmap(struct mm_struct * mm)
int retval;
flush_cache_mm(current->mm);
+ down(&current->mm->mmap_sem);
pprev = &mm->mmap;
for (mpnt = current->mm->mmap ; mpnt ; mpnt = mpnt->vm_next) {
struct file *file;
@@ -257,6 +258,7 @@ static inline int dup_mmap(struct mm_struct * mm)
fail_nomem:
flush_tlb_mm(current->mm);
+ up(&current->mm->mmap_sem);
return retval;
}
@@ -298,13 +300,14 @@ struct mm_struct * mm_alloc(void)
void mmput(struct mm_struct *mm)
{
if (!--mm->count) {
+ release_segments(mm);
exit_mmap(mm);
free_page_tables(mm);
kmem_cache_free(mm_cachep, mm);
}
}
-static inline int copy_mm(unsigned long clone_flags, struct task_struct * tsk)
+static inline int copy_mm(int nr, unsigned long clone_flags, struct task_struct * tsk)
{
struct mm_struct * mm;
int retval;
@@ -324,6 +327,7 @@ static inline int copy_mm(unsigned long clone_flags, struct task_struct * tsk)
tsk->min_flt = tsk->maj_flt = 0;
tsk->cmin_flt = tsk->cmaj_flt = 0;
tsk->nswap = tsk->cnswap = 0;
+ copy_segments(nr, tsk, mm);
retval = new_page_tables(tsk);
if (retval)
goto free_mm;
@@ -514,6 +518,7 @@ int do_fork(unsigned long clone_flags, unsigned long usp, struct pt_regs *regs)
/* ?? should we just memset this ?? */
for(i = 0; i < smp_num_cpus; i++)
p->per_cpu_utime[i] = p->per_cpu_stime[i] = 0;
+ spin_lock_init(&p->sigmask_lock);
}
#endif
p->lock_depth = 0;
@@ -539,7 +544,7 @@ int do_fork(unsigned long clone_flags, unsigned long usp, struct pt_regs *regs)
goto bad_fork_cleanup_files;
if (copy_sighand(clone_flags, p))
goto bad_fork_cleanup_fs;
- if (copy_mm(clone_flags, p))
+ if (copy_mm(nr, clone_flags, p))
goto bad_fork_cleanup_sighand;
error = copy_thread(nr, clone_flags, usp, p, regs);
if (error)