summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2011-04-05 21:31:59 +0000
committerBob Beck <beck@cvs.openbsd.org>2011-04-05 21:31:59 +0000
commit9c6a1c4acfd9cca58f22273d12ecbe06f133329b (patch)
tree48e636fb90317d71fefd26b4ce950246d9b8a735 /sys
parent6e77b8380c3db497c799d8168d9f686409cd2643 (diff)
fix nasty buffer cache bug where we could forget about pages shrunk off of a
buffer as the result of bread_cluster. ok art@ thib@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_biomem.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/vfs_biomem.c b/sys/kern/vfs_biomem.c
index 4d55308cbd1..17c5007441a 100644
--- a/sys/kern/vfs_biomem.c
+++ b/sys/kern/vfs_biomem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_biomem.c,v 1.15 2011/04/02 16:47:17 beck Exp $ */
+/* $OpenBSD: vfs_biomem.c,v 1.16 2011/04/05 21:31:58 beck Exp $ */
/*
* Copyright (c) 2007 Artur Grabowski <art@openbsd.org>
*
@@ -231,6 +231,7 @@ buf_shrink_mem(struct buf *bp, vsize_t newsize)
if (newsize < bp->b_bufsize) {
pmap_kremove(va + newsize, bp->b_bufsize - newsize);
pmap_update(pmap_kernel());
+ bcstats.numbufpages -= atop(bp->b_bufsize - newsize);
bp->b_bufsize = newsize;
}
}