patch-2.0.1 linux/mm/mremap.c

Next file: linux/mm/swapfile.c
Previous file: linux/lib/ctype.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.0/linux/mm/mremap.c linux/mm/mremap.c
@@ -167,8 +167,6 @@
 		return -EINVAL;
 	old_len = PAGE_ALIGN(old_len);
 	new_len = PAGE_ALIGN(new_len);
-	if (old_len == new_len)
-		return addr;
 
 	/*
 	 * Always allow a shrinking remap: that just unmaps
@@ -196,7 +194,8 @@
 	}
 
 	/* old_len exactly to the end of the area.. */
-	if (old_len == vma->vm_end - addr) {
+	if (old_len == vma->vm_end - addr &&
+	    (old_len != new_len || !(flags & MREMAP_MAYMOVE))) {
 		unsigned long max_addr = TASK_SIZE;
 		if (vma->vm_next)
 			max_addr = vma->vm_next->vm_start;

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