patch-1.3.56 linux/mm/memory.c

Next file: linux/mm/swap.c
Previous file: linux/mm/filemap.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.55/linux/mm/memory.c linux/mm/memory.c
@@ -905,21 +905,19 @@
 		get_empty_page(tsk, vma, page_table);
 		return;
 	}
-	page = __get_free_page(GFP_KERNEL);
-	if (!page) {
-		oom(tsk);
-		put_page(page_table, BAD_PAGE);
-		return;
-	}
 	++tsk->maj_flt;
 	++vma->vm_mm->rss;
 	/*
-	 * The fourth argument is "no_share", which tells the low-level code
+	 * The third argument is "no_share", which tells the low-level code
 	 * to copy, not share the page even if sharing is possible.  It's
 	 * essentially an early COW detection 
 	 */
-	page = vma->vm_ops->nopage(vma, address, page,
-		write_access && !(vma->vm_flags & VM_SHARED));
+	page = vma->vm_ops->nopage(vma, address, write_access && !(vma->vm_flags & VM_SHARED));
+	if (!page) {
+		send_sig(SIGBUS, current, 1);
+		put_page(page_table, BAD_PAGE);
+		return;
+	}
 	/*
 	 * This silly early PAGE_DIRTY setting removes a race
 	 * due to the bad i386 page protection. But it's valid

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this