1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-13 10:02:38 +00:00

vm_page_is_valid() wasn't expecting a large offset argument, it's

expecting a sub-page offset.  We were passing the file position,
and vm_page_bits() could do some interesting things when base was
larger PAGE_SIZE.
if (size > PAGE_SIZE - base)
	size = PAGE_SIZE - base;
is interesting when (PAGE_SIZE - base) is negative.  I could imagine that
this could have interesting consequences for memory page -> device block
bit validation.
This commit is contained in:
Peter Wemm 1998-05-01 15:10:59 +00:00
parent f806d5a257
commit b1951f4028
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=35590

View File

@ -11,7 +11,7 @@
* 2. Absolutely no warranty of function or purpose is made by the author
* John S. Dyson.
*
* $Id: vfs_bio.c,v 1.162 1998/04/17 22:36:51 des Exp $
* $Id: vfs_bio.c,v 1.163 1998/05/01 15:04:35 peter Exp $
*/
/*
@ -1322,7 +1322,8 @@ inmem(struct vnode * vp, daddr_t blkno)
m = vm_page_lookup(obj, OFF_TO_IDX(off + toff));
if (!m)
return 0;
if (vm_page_is_valid(m, (vm_offset_t) (toff + off), tinc) == 0)
if (vm_page_is_valid(m,
(vm_offset_t) ((toff + off) & PAGE_MASK), tinc) == 0)
return 0;
}
return 1;