summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_io.c
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2009-06-30 14:34:06 +0000
committertrasz <trasz@FreeBSD.org>2009-06-30 14:34:06 +0000
commit669f7d97123995ef2239c7ef3717723a3eaeb1f7 (patch)
treed399548324c2614a0a754390fcaade73189e799a /sys/geom/geom_io.c
parent02a0b3a8398eef5365dd98db3badaafdd0b77480 (diff)
downloadFreeBSD-src-669f7d97123995ef2239c7ef3717723a3eaeb1f7.zip
FreeBSD-src-669f7d97123995ef2239c7ef3717723a3eaeb1f7.tar.gz
Make gjournal work with kernel compiled with "options DIAGNOSTIC".
Previously, it would panic immediately. Reviewed by: pjd Approved by: re (kib)
Diffstat (limited to 'sys/geom/geom_io.c')
-rw-r--r--sys/geom/geom_io.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c
index cfb8c74..61ca41c 100644
--- a/sys/geom/geom_io.c
+++ b/sys/geom/geom_io.c
@@ -480,14 +480,6 @@ g_io_deliver(struct bio *bp, int error)
KASSERT(bp != NULL, ("NULL bp in g_io_deliver"));
pp = bp->bio_to;
KASSERT(pp != NULL, ("NULL bio_to in g_io_deliver"));
-#ifdef DIAGNOSTIC
- KASSERT(bp->bio_caller1 == bp->_bio_caller1,
- ("bio_caller1 used by the provider %s", pp->name));
- KASSERT(bp->bio_caller2 == bp->_bio_caller2,
- ("bio_caller2 used by the provider %s", pp->name));
- KASSERT(bp->bio_cflags == bp->_bio_cflags,
- ("bio_cflags used by the provider %s", pp->name));
-#endif
cp = bp->bio_from;
if (cp == NULL) {
bp->bio_error = error;
@@ -496,6 +488,21 @@ 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"));
+#ifdef DIAGNOSTIC
+ /*
+ * Some classes - GJournal in particular - can modify bio's
+ * private fields while the bio is in transit; G_GEOM_VOLATILE_BIO
+ * flag means it's an expected behaviour for that particular geom.
+ */
+ if ((cp->geom->flags & G_GEOM_VOLATILE_BIO) == 0) {
+ KASSERT(bp->bio_caller1 == bp->_bio_caller1,
+ ("bio_caller1 used by the provider %s", pp->name));
+ KASSERT(bp->bio_caller2 == bp->_bio_caller2,
+ ("bio_caller2 used by the provider %s", pp->name));
+ KASSERT(bp->bio_cflags == bp->_bio_cflags,
+ ("bio_cflags used by the provider %s", pp->name));
+ }
+#endif
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"));
OpenPOWER on IntegriCloud