]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
block: prohibit calls to bio_chain_endio
authorShida Zhang <zhangshida@kylinos.cn>
Tue, 9 Dec 2025 09:01:57 +0000 (17:01 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 9 Dec 2025 17:20:03 +0000 (10:20 -0700)
Now that all potential callers of bio_chain_endio have been
eliminated, completely prohibit any future calls to this function.

Suggested-by: Ming Lei <ming.lei@redhat.com>
Suggested-by: Andreas Gruenbacher <agruenba@redhat.com>
Suggested-by: Christoph Hellwig <hch@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Shida Zhang <zhangshida@kylinos.cn>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c

index fa5ff36b443f9104142c1e8405f94cb4e109e8d9..e726c0e280a8dc85ef823511f1c59547ada5b3bd 100644 (file)
@@ -321,9 +321,13 @@ static struct bio *__bio_chain_endio(struct bio *bio)
        return parent;
 }
 
+/*
+ * This function should only be used as a flag and must never be called.
+ * If execution reaches here, it indicates a serious programming error.
+ */
 static void bio_chain_endio(struct bio *bio)
 {
-       bio_endio(__bio_chain_endio(bio));
+       BUG();
 }
 
 /**