patch-2.3.13 linux/arch/m68k/mm/fault.c

Next file: linux/arch/m68k/mm/init.c
Previous file: linux/arch/m68k/mac/adb-bus.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.12/linux/arch/m68k/mm/fault.c linux/arch/m68k/mm/fault.c
@@ -36,7 +36,7 @@
 	struct mm_struct *mm = current->mm;
 	struct vm_area_struct * vma;
 	unsigned long fixup;
-	int write;
+	int write, fault;
 
 #ifdef DEBUG
 	printk ("regs->sr=%#x, regs->pc=%#lx, address=%#lx, %ld, %p\n",
@@ -44,7 +44,6 @@
 		current->mm->pgd);
 #endif
 
-
 	/*
 	 * If we're in an interrupt or have no user
 	 * context, we must not take the fault..
@@ -100,7 +99,10 @@
 	 * make sure we exit gracefully rather than endlessly redo
 	 * the fault.
 	 */
-	if (!handle_mm_fault(current, vma, address, write))
+	fault = handle_mm_fault(current, vma, address, write);
+	if (fault < 0)
+		goto out_of_memory;
+	if (!fault)
 		goto do_sigbus;
 
 	/* There seems to be a missing invalidate somewhere in do_no_page.
@@ -160,6 +162,13 @@
  * We ran out of memory, or some other thing happened to us that made
  * us unable to handle the page fault gracefully.
  */
+out_of_memory:
+	up(&mm->mmap_sem);
+	printk("VM: killing process %s\n", current->comm);
+	if (error_code & 4)
+		do_exit(SIGKILL);
+	goto no_context;
+
 do_sigbus:
 	up(&mm->mmap_sem);
 

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