From 806f17c2f7bf5f0277e49b70e25a83eecdc47586 Mon Sep 17 00:00:00 2001 From: Coly Li Date: Tue, 13 Jan 2026 14:09:39 +0800 Subject: [PATCH] Revert "bcache: fix improper use of bi_end_io" This reverts commit 53280e398471f0bddbb17b798a63d41264651325. The above commit tries to address the race in bio chain handling, but it seems in detached_dev_end_io() simply using bio_endio() to replace bio->bi_end_io() may introduce potential regression. This patch revert the commit, let's wait for better fix from Shida. Signed-off-by: Coly Li Cc: Christoph Hellwig Cc: Shida Zhang Cc: Kent Overstreet --- drivers/md/bcache/request.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index 82fdea7dea7aa..af345dc6fde14 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c @@ -1104,7 +1104,7 @@ static void detached_dev_end_io(struct bio *bio) } kfree(ddip); - bio_endio(bio); + bio->bi_end_io(bio); } static void detached_dev_do_request(struct bcache_device *d, struct bio *bio, @@ -1121,7 +1121,7 @@ static void detached_dev_do_request(struct bcache_device *d, struct bio *bio, ddip = kzalloc(sizeof(struct detached_dev_io_private), GFP_NOIO); if (!ddip) { bio->bi_status = BLK_STS_RESOURCE; - bio_endio(bio); + bio->bi_end_io(bio); return; } @@ -1136,7 +1136,7 @@ static void detached_dev_do_request(struct bcache_device *d, struct bio *bio, if ((bio_op(bio) == REQ_OP_DISCARD) && !bdev_max_discard_sectors(dc->bdev)) - detached_dev_end_io(bio); + bio->bi_end_io(bio); else submit_bio_noacct(bio); }