From adec8f43387c91bdf13103ba82c16a2af8b77f27 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Mon, 27 Sep 1999 00:27:32 +0000 Subject: [PATCH] If the request crosses EOF and bp->b_bcount is not a multiple of the sector size, the new value for bp->b_bcount was incorrectly calculated. Fixed. Submitted by: Tor.Egge@fast.no --- sys/dev/vn/vn.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/vn/vn.c b/sys/dev/vn/vn.c index 377c37df86ff..2994fda03fe8 100644 --- a/sys/dev/vn/vn.c +++ b/sys/dev/vn/vn.c @@ -334,8 +334,7 @@ vnstrategy(struct buf *bp) * If the request crosses EOF, truncate the request. */ if (pbn + sz > vn->sc_size) { - bp->b_bcount -= (pbn + sz - vn->sc_size) * - vn->sc_secsize; + bp->b_bcount = (vn->sc_size - pbn) * vn->sc_secsize; bp->b_resid = bp->b_bcount; } bp->b_pblkno = pbn;