Re: PROBLEM: double fault in md_end_io
From: Song Liu <song@kernel.org>
Date: 2021-05-06 05:48:59
Hi Paweł, On Tue, May 4, 2021 at 2:18 PM Paweł Wiejacha [off-list ref] wrote:
Guoqing's patch fixes the problem. Here's the actual patch I am using:
Thanks for running the tests. Hi Guoqing, Could you please send official patch for this fix? Thanks, Song
quoted hunk ↗ jump to hunk
-static void bio_chain_endio(struct bio *bio) +void bio_chain_endio(struct bio *bio) { bio_endio(__bio_chain_endio(bio)); } +EXPORT_SYMBOL(bio_chain_endio); /** * bio_chain - chain bio completionsdiff --git drivers/md/md.c drivers/md/md.c index 04384452a7ab..f157bd6e0478 100644 --- drivers/md/md.c +++ drivers/md/md.c@@ -507,7 +507,8 @@ static blk_qc_t md_submit_bio(struct bio *bio) return BLK_QC_T_NONE; } - if (bio->bi_end_io != md_end_io) { + if (bio->bi_end_io != md_end_io && bio->bi_end_io != + bio_chain_endio) { struct md_io *md_io; md_io = mempool_alloc(&mddev->md_io_pool, GFP_NOIO);diff --git include/linux/bio.h include/linux/bio.h index 1edda614f7ce..bfb5bd0be397 100644 --- include/linux/bio.h +++ include/linux/bio.h@@ -427,6 +427,7 @@ static inline struct bio *bio_kmalloc(gfp_tgfp_mask, unsigned int nr_iovecs) extern blk_qc_t submit_bio(struct bio *); extern void bio_endio(struct bio *); +extern void bio_chain_endio(struct bio *bio);
[...]