summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1998-05-01 15:10:59 +0000
committerpeter <peter@FreeBSD.org>1998-05-01 15:10:59 +0000
commitdfa49715ca9331d53491386a3a06c81c042f29ad (patch)
tree14f0526f1d28a2d2f16b1cd43bd9e2aa0fe3c344 /sys
parente5ab5108e0bd23f5d2803ace98244e35666ab2fb (diff)
downloadFreeBSD-src-dfa49715ca9331d53491386a3a06c81c042f29ad.zip
FreeBSD-src-dfa49715ca9331d53491386a3a06c81c042f29ad.tar.gz
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_bio.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 3c2b4c1..686158b 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -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;
OpenPOWER on IntegriCloud