Skip to content

Commit cfdeb58

Browse files
Shida Zhangaxboe
authored andcommitted
block: prohibit calls to bio_chain_endio
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>
1 parent 53280e3 commit cfdeb58

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

block/bio.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,13 @@ static struct bio *__bio_chain_endio(struct bio *bio)
321321
return parent;
322322
}
323323

324+
/*
325+
* This function should only be used as a flag and must never be called.
326+
* If execution reaches here, it indicates a serious programming error.
327+
*/
324328
static void bio_chain_endio(struct bio *bio)
325329
{
326-
bio_endio(__bio_chain_endio(bio));
330+
BUG();
327331
}
328332

329333
/**

0 commit comments

Comments
 (0)