From 37382454e087ae1464efd48a594a7edfd8db95d2 Mon Sep 17 00:00:00 2001 From: pjd Date: Sun, 4 Apr 2004 20:37:28 +0000 Subject: Calculate bio_completed properly or die! Approved by: phk --- sys/geom/geom_io.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sys/geom') diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c index 507069b..3c32972 100644 --- a/sys/geom/geom_io.c +++ b/sys/geom/geom_io.c @@ -279,6 +279,9 @@ g_io_deliver(struct bio *bp, int error) } KASSERT(cp != NULL, ("NULL bio_from in g_io_deliver")); KASSERT(cp->geom != NULL, ("NULL bio_from->geom in g_io_deliver")); + KASSERT(bp->bio_completed >= 0, ("bio_completed can't be less than 0")); + KASSERT(bp->bio_completed <= bp->bio_length, + ("bio_completed can't be greater than bio_length")); g_trace(G_T_BIO, "g_io_deliver(%p) from %p(%s) to %p(%s) cmd %d error %d off %jd len %jd", -- cgit v1.1