Added a check for wrong object size; print a warning, but deal with it

correctly. The warning will tell us that there is a bug somewhere else
in sizing the object correctly.

Submitted by:	John Dyson
This commit is contained in:
dg 1995-03-22 05:12:18 +00:00
parent 0c24a80ae8
commit 08726c6d9b

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.30 1995/03/11 22:25:02 davidg Exp $
* $Id: swap_pager.c,v 1.31 1995/03/19 14:29:24 davidg Exp $
*/
/*
@ -1282,6 +1282,14 @@ swap_pager_output(swp, m, count, flags, rtvals)
*/
if (ntoget * PAGE_SIZE > object->size) {
ntoget = (object->size + (PAGE_SIZE - 1)) / PAGE_SIZE;
/*
* make sure that we include the needed page
*/
if (ntoget <= off) {
printf("swap_pager_output: page outside of object -- %d, %d\n",
m[j]->offset, object->size);
ntoget = off + 1;
}
}
retrygetspace:
if (!swap_pager_full && ntoget > 1 &&