From 08726c6d9b4d40afb20c40216b70c0ab5a8da933 Mon Sep 17 00:00:00 2001 From: dg Date: Wed, 22 Mar 1995 05:12:18 +0000 Subject: [PATCH] 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 --- sys/vm/swap_pager.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 101933a3eeba..928a91e6ebfa 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 &&