summaryrefslogtreecommitdiffstats
path: root/arch/i386/mm
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-09-28 22:25:29 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-09-28 22:25:29 +0000
commit0ae8dceaebe3659ee0c3352c08125f403e77ebca (patch)
tree5085c389f09da78182b899d19fe1068b619a69dd /arch/i386/mm
parent273767781288c35c9d679e908672b9996cda4c34 (diff)
Merge with 2.3.10.
Diffstat (limited to 'arch/i386/mm')
-rw-r--r--arch/i386/mm/fault.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c
index 5a1f363bd..c3e423b21 100644
--- a/arch/i386/mm/fault.c
+++ b/arch/i386/mm/fault.c
@@ -50,7 +50,8 @@ good_area:
start &= PAGE_MASK;
for (;;) {
- handle_mm_fault(current,vma, start, 1);
+ if (handle_mm_fault(current, vma, start, 1) <= 0)
+ goto bad_area;
if (!size)
break;
size--;
@@ -162,8 +163,13 @@ good_area:
* make sure we exit gracefully rather than endlessly redo
* the fault.
*/
- if (!handle_mm_fault(tsk, vma, address, write))
- goto do_sigbus;
+ {
+ int fault = handle_mm_fault(tsk, vma, address, write);
+ if (fault < 0)
+ goto out_of_memory;
+ if (!fault)
+ goto do_sigbus;
+ }
/*
* Did it hit the DOS screen memory VA from vm86 mode?
@@ -255,6 +261,13 @@ no_context:
* 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", tsk->comm);
+ if (error_code & 4)
+ do_exit(SIGKILL);
+ goto no_context;
+
do_sigbus:
up(&mm->mmap_sem);