public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "bcache: fix improper use of bi_end_io"
@ 2026-01-13  6:09 colyli
  2026-01-13  8:07 ` Christoph Hellwig
  0 siblings, 1 reply; 18+ messages in thread
From: colyli @ 2026-01-13  6:09 UTC (permalink / raw)
  To: axboe
  Cc: linux-block, linux-bcache, Coly Li, Christoph Hellwig,
	Shida Zhang, Kent Overstreet

From: Coly Li <colyli@fnnas.com>

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 <colyli@fnnas.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Shida Zhang <zhangshida@kylinos.cn>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
---
 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 82fdea7dea7a..af345dc6fde1 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);
 }
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2026-01-19 15:57 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-13  6:09 [PATCH] Revert "bcache: fix improper use of bi_end_io" colyli
2026-01-13  8:07 ` Christoph Hellwig
2026-01-13  8:30   ` Kent Overstreet
2026-01-13  8:34     ` Christoph Hellwig
2026-01-13  8:39       ` Kent Overstreet
2026-01-13  8:58         ` Christoph Hellwig
2026-01-13  9:27           ` Kent Overstreet
2026-01-13 15:00             ` Christoph Hellwig
2026-01-13 15:30               ` Kent Overstreet
2026-01-13 16:18           ` Coly Li
2026-01-13 16:26             ` Christoph Hellwig
2026-01-13 16:34               ` Kent Overstreet
2026-01-19  9:51                 ` Daniel Wagner
2026-01-19 10:18                   ` Kent Overstreet
2026-01-19 10:34                     ` Daniel Wagner
2026-01-19 15:57                       ` Daniel Wagner
2026-01-13 16:22   ` Coly Li
2026-01-13 16:25     ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox