aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Greenman <dg@FreeBSD.org>1994-11-06 09:55:31 +0000
committerDavid Greenman <dg@FreeBSD.org>1994-11-06 09:55:31 +0000
commita83c285c7ef19dd6f495f82b7a11a4a686581b05 (patch)
tree4b8dc784e9fcb7bdf36f31c5a49f22dd595519d6
parent02ebab5bf9f54850cfe0de08632029cc777443ac (diff)
downloadsrc-a83c285c7ef19dd6f495f82b7a11a4a686581b05.tar.gz
src-a83c285c7ef19dd6f495f82b7a11a4a686581b05.zip
Fixed return status from pagers. Ahem...the previous method would manufacture
data when it couldn't get it legitimately. :-( Submitted by: John Dyson
Notes
Notes: svn path=/head/; revision=4207
-rw-r--r--sys/vm/swap_pager.c8
-rw-r--r--sys/vm/vm_fault.c16
-rw-r--r--sys/vm/vnode_pager.c18
3 files changed, 25 insertions, 17 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 9f0654b238bd..04b273bb70d1 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -39,7 +39,7 @@
* from: Utah $Hdr: swap_pager.c 1.4 91/04/30$
*
* @(#)swap_pager.c 8.9 (Berkeley) 3/21/94
- * $Id: swap_pager.c,v 1.15 1994/10/22 02:17:59 davidg Exp $
+ * $Id: swap_pager.c,v 1.16 1994/10/25 07:06:20 davidg Exp $
*/
/*
@@ -1105,7 +1105,7 @@ swap_pager_input(swp, m, count, reqpage)
if (bp->b_flags & B_ERROR) {
printf("swap_pager: I/O error - pagein failed; blkno %d, size %d, error %d\n",
bp->b_blkno, bp->b_bcount, bp->b_error);
- rv = VM_PAGER_FAIL;
+ rv = VM_PAGER_ERROR;
} else {
rv = VM_PAGER_OK;
}
@@ -1506,7 +1506,7 @@ retrygetspace:
if (bp->b_flags & B_ERROR) {
printf("swap_pager: I/O error - pageout failed; blkno %d, size %d, error %d\n",
bp->b_blkno, bp->b_bcount, bp->b_error);
- rv = VM_PAGER_FAIL;
+ rv = VM_PAGER_ERROR;
} else {
rv = VM_PAGER_OK;
}
@@ -1632,7 +1632,7 @@ swap_pager_finish(spc)
*/
if (spc->spc_flags & SPC_ERROR) {
for(i=0;i<spc->spc_count;i++) {
- printf("swap_pager_finish: clean of page %lx failed\n",
+ printf("swap_pager_finish: I/O error, clean of page %lx failed\n",
(u_long)VM_PAGE_TO_PHYS(spc->spc_m[i]));
spc->spc_m[i]->flags |= PG_LAUNDRY;
}
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index 586f772dca24..eb0048c012ae 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -66,7 +66,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_fault.c,v 1.10 1994/10/22 02:18:01 davidg Exp $
+ * $Id: vm_fault.c,v 1.11 1994/10/23 06:15:03 davidg Exp $
*/
/*
@@ -83,6 +83,7 @@
#include <vm/vm.h>
#include <vm/vm_page.h>
#include <vm/vm_pageout.h>
+#include <vm/vm_kern.h>
int vm_fault_additional_pages __P((vm_object_t, vm_offset_t, vm_page_t, int, int, vm_page_t *, int *));
@@ -422,14 +423,21 @@ vm_fault(map, vaddr, fault_type, change_wiring)
* that we are.
*/
+ if (rv == VM_PAGER_ERROR)
+ printf("vm_fault: pager input (probably hardware) error, PID %d failure\n",
+ curproc->p_pid);
vm_object_lock(object);
/*
- * Data outside the range of the pager; an error
+ * Data outside the range of the pager or an I/O error
*/
- if ((rv == VM_PAGER_ERROR) || (rv == VM_PAGER_BAD)) {
+ /*
+ * XXX - the check for kernel_map is a kludge to work around
+ * having the machine panic on a kernel space fault w/ I/O error.
+ */
+ if (((map != kernel_map) && (rv == VM_PAGER_ERROR)) || (rv == VM_PAGER_BAD)) {
FREE_PAGE(m);
UNLOCK_AND_DEALLOCATE;
- return(KERN_PROTECTION_FAILURE); /* XXX */
+ return ((rv == VM_PAGER_ERROR) ? KERN_FAILURE : KERN_PROTECTION_FAILURE);
}
if (object != first_object) {
FREE_PAGE(m);
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c
index a1945887de47..19f40e316c64 100644
--- a/sys/vm/vnode_pager.c
+++ b/sys/vm/vnode_pager.c
@@ -37,7 +37,7 @@
* SUCH DAMAGE.
*
* from: @(#)vnode_pager.c 7.5 (Berkeley) 4/20/91
- * $Id: vnode_pager.c,v 1.13 1994/10/14 12:26:18 davidg Exp $
+ * $Id: vnode_pager.c,v 1.14 1994/10/15 13:33:09 davidg Exp $
*/
/*
@@ -688,7 +688,7 @@ nextblock:
}
vm_pager_unmap_page(kva);
if (error) {
- return VM_PAGER_FAIL;
+ return VM_PAGER_ERROR;
}
pmap_clear_modify(VM_PAGE_TO_PHYS(m));
m->flags |= PG_CLEAN;
@@ -754,7 +754,7 @@ vnode_pager_input_old(vnp, m)
pmap_clear_modify(VM_PAGE_TO_PHYS(m));
m->flags |= PG_CLEAN;
m->flags &= ~PG_LAUNDRY;
- return error ? VM_PAGER_FAIL : VM_PAGER_OK;
+ return error ? VM_PAGER_ERROR : VM_PAGER_OK;
}
/*
@@ -1137,9 +1137,9 @@ finishup:
}
}
if (error) {
- printf("vnode_pager_input: read error\n");
+ printf("vnode_pager_input: I/O read error\n");
}
- return (error ? VM_PAGER_FAIL : VM_PAGER_OK);
+ return (error ? VM_PAGER_ERROR : VM_PAGER_OK);
}
/*
@@ -1193,7 +1193,7 @@ vnode_pager_output_old(vnp, m)
}
}
vm_pager_unmap_page(kva);
- return error ? VM_PAGER_FAIL : VM_PAGER_OK;
+ return error ? VM_PAGER_ERROR: VM_PAGER_OK;
}
}
@@ -1283,7 +1283,7 @@ vnode_pager_output_smlfs(vnp, m)
}
vm_pager_unmap_page(kva);
if (error)
- return VM_PAGER_FAIL;
+ return VM_PAGER_ERROR;
else
return VM_PAGER_OK;
}
@@ -1502,7 +1502,7 @@ retryoutput:
goto retryoutput;
}
if (error) {
- printf("vnode_pager_output: write error\n");
+ printf("vnode_pager_output: I/O write error\n");
}
- return (error ? VM_PAGER_FAIL : VM_PAGER_OK);
+ return (error ? VM_PAGER_ERROR: VM_PAGER_OK);
}