From 38da0c96dc1b4698931f65d8d58e864dfc3a600e Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Thu, 27 Jan 2022 09:58:19 -0500 Subject: [PATCH] geom: Assert that BIO_SPEEDUP BIOs have bio_data set to NULL Like BIO_FLUSH, there is no reason for consumers to pass a BIO_SPEEDUP request with non-NULL bio_data, so assert this. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- sys/geom/geom_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c index 6ec90741a7e2..a5cb8c7279e4 100644 --- a/sys/geom/geom_io.c +++ b/sys/geom/geom_io.c @@ -521,7 +521,7 @@ g_io_request(struct bio *bp, struct g_consumer *cp) KASSERT(bp->bio_data != NULL, ("NULL bp->data in g_io_request(cmd=%hu)", bp->bio_cmd)); } - if (cmd == BIO_DELETE || cmd == BIO_FLUSH) { + if (cmd == BIO_DELETE || cmd == BIO_FLUSH || cmd == BIO_SPEEDUP) { KASSERT(bp->bio_data == NULL, ("non-NULL bp->data in g_io_request(cmd=%hu)", bp->bio_cmd));