summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-10-14 10:02:24 +0000
committerphk <phk@FreeBSD.org>2002-10-14 10:02:24 +0000
commit8298a7f6adc2cfd2fc6b8357666aafea5f738ed5 (patch)
treed375be22c1ad8d82eed576c62ae3377b242d7140
parentd9865aa4d5611249e32729a34e06e1d59fabeaec (diff)
downloadFreeBSD-src-8298a7f6adc2cfd2fc6b8357666aafea5f738ed5.zip
FreeBSD-src-8298a7f6adc2cfd2fc6b8357666aafea5f738ed5.tar.gz
Add more KASSERTS.
Sponsored by: DARPA & NAI Labs.
-rw-r--r--sys/geom/geom_dump.c2
-rw-r--r--sys/geom/geom_io.c8
2 files changed, 8 insertions, 2 deletions
diff --git a/sys/geom/geom_dump.c b/sys/geom/geom_dump.c
index 5b29835..b944991 100644
--- a/sys/geom/geom_dump.c
+++ b/sys/geom/geom_dump.c
@@ -219,11 +219,11 @@ void
g_confxml(void *p)
{
+ g_topology_assert();
g_conf_specific(p, NULL, NULL, NULL, NULL);
wakeup(p);
}
-
void
g_trace(int level, char *fmt, ...)
{
diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c
index deb8978..a33c2ee 100644
--- a/sys/geom/geom_io.c
+++ b/sys/geom/geom_io.c
@@ -212,7 +212,9 @@ g_io_request(struct bio *bp, struct g_consumer *cp)
int error;
off_t excess;
- KASSERT(cp != NULL, ("bio_request on thin air"));
+ KASSERT(cp != NULL, ("NULL cp in g_io_request"));
+ KASSERT(bp != NULL, ("NULL bp in g_io_request"));
+ KASSERT(bp->bio_data != NULL, ("NULL bp->data in g_io_request"));
error = 0;
bp->bio_from = cp;
bp->bio_to = cp->provider;
@@ -300,6 +302,10 @@ void
g_io_deliver(struct bio *bp, int error)
{
+ KASSERT(bp != NULL, ("NULL bp in g_io_deliver"));
+ KASSERT(bp->bio_from != NULL, ("NULL bio_from in g_io_deliver"));
+ KASSERT(bp->bio_from->geom != NULL, ("NULL bio_from->geom in g_io_deliver"));
+ KASSERT(bp->bio_to != NULL, ("NULL bio_to in g_io_deliver"));
g_trace(G_T_BIO,
"g_io_deliver(%p) from %p(%s) to %p(%s) cmd %d error %d",
bp, bp->bio_from, bp->bio_from->geom->name,
OpenPOWER on IntegriCloud