patch-2.1.19 linux/kernel/fork.c

Next file: linux/mm/mmap.c
Previous file: linux/kernel/exit.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.18/linux/kernel/fork.c linux/kernel/fork.c
@@ -22,6 +22,7 @@
 
 #include <asm/system.h>
 #include <asm/pgtable.h>
+#include <asm/mmu_context.h>
 #include <asm/uaccess.h>
 
 int nr_tasks=1;
@@ -118,6 +119,7 @@
 		if (!mm)
 			return -1;
 		*mm = *current->mm;
+		init_new_context(mm);
 		mm->count = 1;
 		mm->def_flags = 0;
 		tsk->mm = mm;
@@ -132,8 +134,8 @@
 		}
 		return 0;
 	}
-	SET_PAGE_DIR(tsk, current->mm->pgd);
 	current->mm->count++;
+	SET_PAGE_DIR(tsk, current->mm->pgd);
 	return 0;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov