1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

Check that the swap block is valid before including it in a cluster.

Submitted by:	John Dyson
This commit is contained in:
David Greenman 1995-09-24 04:40:19 +00:00
parent 69c1a301a3
commit 2f82e60467
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=10984

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.45 1995/09/06 07:08:45 dyson Exp $
* $Id: swap_pager.c,v 1.46 1995/09/11 00:47:17 dyson Exp $
*/
/*
@ -728,6 +728,8 @@ swap_pager_haspage(object, offset, before, after)
int tix;
if (before) {
for(tix = ix - 1; tix >= 0; --tix) {
if ((swb->swb_valid & (1 << tix)) == 0)
break;
if ((swb->swb_block[tix] +
(ix - tix) * (PAGE_SIZE/DEV_BSIZE)) !=
swb->swb_block[ix])
@ -738,6 +740,8 @@ swap_pager_haspage(object, offset, before, after)
if (after) {
for(tix = ix + 1; tix < SWB_NPAGES; tix++) {
if ((swb->swb_valid & (1 << tix)) == 0)
break;
if ((swb->swb_block[tix] -
(tix - ix) * (PAGE_SIZE/DEV_BSIZE)) !=
swb->swb_block[ix])