patch-2.1.20 linux/kernel/fork.c

Next file: linux/mm/memory.c
Previous file: linux/init/main.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.19/linux/kernel/fork.c linux/kernel/fork.c
@@ -82,10 +82,12 @@
 
 	mm->mmap = NULL;
 	p = &mm->mmap;
+	flush_cache_mm(current->mm);
 	for (mpnt = current->mm->mmap ; mpnt ; mpnt = mpnt->vm_next) {
 		tmp = (struct vm_area_struct *) kmalloc(sizeof(struct vm_area_struct), GFP_KERNEL);
 		if (!tmp) {
 			exit_mmap(mm);
+			flush_tlb_mm(current->mm);
 			return -ENOMEM;
 		}
 		*tmp = *mpnt;
@@ -101,6 +103,7 @@
 		}
 		if (copy_page_range(mm, current->mm, tmp)) {
 			exit_mmap(mm);
+			flush_tlb_mm(current->mm);
 			return -ENOMEM;
 		}
 		if (tmp->vm_ops && tmp->vm_ops->open)
@@ -108,6 +111,7 @@
 		*p = tmp;
 		p = &tmp->vm_next;
 	}
+	flush_tlb_mm(current->mm);
 	build_mmap_avl(mm);
 	return 0;
 }

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