summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_cluster.c
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>2001-10-25 22:49:48 +0000
committerMatthew Dillon <dillon@FreeBSD.org>2001-10-25 22:49:48 +0000
commitf02098e59c36847e0c94fe8ec3f13ca703957c4f (patch)
treecd988e95d101c4bdf78edd58c8b8e51655541a76 /sys/kern/vfs_cluster.c
parent18d730731d218e59a11eb28d368f37260f34bdcf (diff)
Notes
Diffstat (limited to 'sys/kern/vfs_cluster.c')
-rw-r--r--sys/kern/vfs_cluster.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c
index a2b97a7cfb90..0af9fedac447 100644
--- a/sys/kern/vfs_cluster.c
+++ b/sys/kern/vfs_cluster.c
@@ -477,8 +477,20 @@ cluster_rbuild(vp, filesize, lbn, blkno, size, run, fbp)
if ((m->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL)
tbp->b_pages[j] = bogus_page;
}
- bp->b_bcount += tbp->b_bcount;
- bp->b_bufsize += tbp->b_bufsize;
+ /*
+ * XXX shouldn't this be += size for both, like in
+ * cluster_wbuild()?
+ *
+ * Don't inherit tbp->b_bufsize as it may be larger due to
+ * a non-page-aligned size. Instead just aggregate using
+ * 'size'.
+ */
+ if (tbp->b_bcount != size)
+ printf("warning: tbp->b_bcount wrong %ld vs %ld\n", tbp->b_bcount, size);
+ if (tbp->b_bufsize != size)
+ printf("warning: tbp->b_bufsize wrong %ld vs %ld\n", tbp->b_bufsize, size);
+ bp->b_bcount += size;
+ bp->b_bufsize += size;
}
/*