1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-23 11:18:54 +00:00

Fixed return status from pagers. Ahem...the previous method would manufacture

data when it couldn't get it legitimately. :-(

Submitted by:	John Dyson
This commit is contained in:
David Greenman 1994-11-06 09:55:31 +00:00
parent 02ebab5bf9
commit a83c285c7e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=4207
3 changed files with 25 additions and 17 deletions

View File

@ -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 @@ swap_pager_output(swp, m, count, flags, rtvals)
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;
}

View File

@ -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);

View File

@ -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 @@ vnode_pager_input_smlfs(vnp, m)
}
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 @@ vnode_pager_input(vnp, m, count, reqpage)
}
}
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 @@ vnode_pager_output(vnp, m, count, rtvals)
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);
}