diff options
author | pjd <pjd@FreeBSD.org> | 2007-01-28 23:36:07 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2007-01-28 23:36:07 +0000 |
commit | cb51d8d01146a48748f82665cc8e2120f7f13408 (patch) | |
tree | 2c3b505cd924729962f2031ea799047ffb95abde /sys | |
parent | f46bb7512b2226e96fcafbde865cfdbba0ed8a20 (diff) | |
download | FreeBSD-src-cb51d8d01146a48748f82665cc8e2120f7f13408.zip FreeBSD-src-cb51d8d01146a48748f82665cc8e2120f7f13408.tar.gz |
We expect 'bio_data != NULL' for BIO_{READ,WRITE,GETATTR}, but for
BIO_{DELETE,FLUSH} we expect 'bio_data == NULL'.
Reviewed by: phk
Diffstat (limited to 'sys')
-rw-r--r-- | sys/geom/geom_io.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c index 18cedcd..e8e00ed 100644 --- a/sys/geom/geom_io.c +++ b/sys/geom/geom_io.c @@ -343,9 +343,14 @@ g_io_request(struct bio *bp, struct g_consumer *cp) bp->_bio_cflags = bp->bio_cflags; #endif - if (bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE|BIO_GETATTR)) { + if (bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_GETATTR)) { KASSERT(bp->bio_data != NULL, - ("NULL bp->data in g_io_request")); + ("NULL bp->data in g_io_request(cmd=%hhu)", bp->bio_cmd)); + } + if (bp->bio_cmd & (BIO_DELETE|BIO_FLUSH)) { + KASSERT(bp->bio_data == NULL, + ("non-NULL bp->data in g_io_request(cmd=%hhu)", + bp->bio_cmd)); } if (bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) { KASSERT(bp->bio_offset % cp->provider->sectorsize == 0, |