summaryrefslogtreecommitdiffstats
path: root/sys/vm/swap_pager.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-03-22 05:12:18 +0000
committerdg <dg@FreeBSD.org>1995-03-22 05:12:18 +0000
commit08726c6d9b4d40afb20c40216b70c0ab5a8da933 (patch)
tree78f87e02e9a2f7431b56a640bc6c27b129086f6c /sys/vm/swap_pager.c
parent0c24a80ae8345c864bf33d02285da373f8f95887 (diff)
downloadFreeBSD-src-08726c6d9b4d40afb20c40216b70c0ab5a8da933.zip
FreeBSD-src-08726c6d9b4d40afb20c40216b70c0ab5a8da933.tar.gz
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
Diffstat (limited to 'sys/vm/swap_pager.c')
-rw-r--r--sys/vm/swap_pager.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 101933a..928a91e 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.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 &&
OpenPOWER on IntegriCloud