Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jan 2022 15:15:06 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 38da0c96dc1b - main - geom: Assert that BIO_SPEEDUP BIOs have bio_data set to NULL
Message-ID:  <202201271515.20RFF6jY006081@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=38da0c96dc1b4698931f65d8d58e864dfc3a600e

commit 38da0c96dc1b4698931f65d8d58e864dfc3a600e
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-01-27 14:58:19 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-01-27 14:58:19 +0000

    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));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202201271515.20RFF6jY006081>