patch-2.2.12 linux/include/linux/mm.h

Next file: linux/include/linux/netdevice.h
Previous file: linux/include/linux/major.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.11/linux/include/linux/mm.h linux/include/linux/mm.h
@@ -355,10 +355,11 @@
 
 	address &= PAGE_MASK;
 	grow = vma->vm_start - address;
-	if (vma->vm_end - address
-	    > (unsigned long) current->rlim[RLIMIT_STACK].rlim_cur ||
-	    (vma->vm_mm->total_vm << PAGE_SHIFT) + grow
-	    > (unsigned long) current->rlim[RLIMIT_AS].rlim_cur)
+	if ((vma->vm_end - address
+	    > current->rlim[RLIMIT_STACK].rlim_cur) ||
+	    ((current->rlim[RLIMIT_AS].rlim_cur < RLIM_INFINITY) &&
+	    ((vma->vm_mm->total_vm << PAGE_SHIFT) + grow
+	    > current->rlim[RLIMIT_AS].rlim_cur)))
 		return -ENOMEM;
 	vma->vm_start = address;
 	vma->vm_offset -= grow;

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