summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2004-04-04 20:37:28 +0000
committerpjd <pjd@FreeBSD.org>2004-04-04 20:37:28 +0000
commit37382454e087ae1464efd48a594a7edfd8db95d2 (patch)
tree4d7eac4cfcd283aa4f1a5404d8b4decc5a882777 /sys/geom
parent2e6142d4d93140acd5fb604c6bec6cc22241afe0 (diff)
downloadFreeBSD-src-37382454e087ae1464efd48a594a7edfd8db95d2.zip
FreeBSD-src-37382454e087ae1464efd48a594a7edfd8db95d2.tar.gz
Calculate bio_completed properly or die!
Approved by: phk
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/geom_io.c3
1 files changed, 3 insertions, 0 deletions
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",
OpenPOWER on IntegriCloud