patch-2.3.43 linux/mm/mmap.c

Next file: linux/mm/mprotect.c
Previous file: linux/mm/mlock.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.42/linux/mm/mmap.c linux/mm/mmap.c
@@ -114,9 +114,9 @@
 		goto out;
 	}
 
-	/* Check against rlimit and stack.. */
+	/* Check against rlimit.. */
 	rlim = current->rlim[RLIMIT_DATA].rlim_cur;
-	if (rlim < RLIM_INFINITY && brk - mm->end_code > rlim)
+	if (rlim < RLIM_INFINITY && brk - mm->start_data > rlim)
 		goto out;
 
 	/* Check against existing mmap mappings. */
@@ -609,8 +609,10 @@
 no_mmaps:
 	first = first >> PGDIR_SHIFT;
 	last = last >> PGDIR_SHIFT;
-	if (last > first)
+	if (last > first) {
 		clear_page_tables(mm, first, last-first);
+		flush_tlb_pgtables(mm, first << PGDIR_SHIFT, last << PGDIR_SHIFT);
+	}
 }
 
 /* Munmap is split into 2 main parts -- this part which finds

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)