patch-2.1.2 linux/mm/mmap.c

Next file: linux/net/ipv4/tcp.c
Previous file: linux/mm/memory.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.1/linux/mm/mmap.c linux/mm/mmap.c
@@ -255,7 +255,8 @@
 
 	/* Private writable mapping? Check memory availability.. */
 	if ((vma->vm_flags & (VM_SHARED | VM_WRITE)) == VM_WRITE) {
-		if (!vm_enough_memory(len >> PAGE_SHIFT)) {
+		if (!(flags & MAP_NORESERVE) &&
+		    !vm_enough_memory(len >> PAGE_SHIFT)) {
 			kfree(vma);
 			return -ENOMEM;
 		}

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