[PATCH] md/raid5: split reshape bios before bitmap accounting
Yu Kuai <[email protected]>
| Newsgroups | gmane.linux.raid,gmane.linux.kernel |
|---|---|
| Message-ID | <[email protected]> |
From: Yu Kuai <[email protected]> Use the shared mddev_bio_split_at_reshape_offset() helper so RAID5 submits only one-side bios to llbitmap during reshape. Signed-off-by: Yu Kuai <[email protected]> --- drivers/md/raid5.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 6786f30dc59b..dde10b5b0ff5 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -6172,10 +6172,18 @@ static bool raid5_make_request(struct mddev *mddev, struct bio * bi) make_discard_request(mddev, bi); md_write_end(mddev); return true; } + bi = mddev_bio_split_at_reshape_offset(mddev, bi, NULL, + &conf->bio_split); + if (!bi) { + if (rw == WRITE) + md_write_end(mddev); + return true; + } + logical_sector = bi->bi_iter.bi_sector & ~((sector_t)RAID5_STRIPE_SECTORS(conf)-1); bi->bi_next = NULL; ctx = mempool_alloc(conf->ctx_pool, GFP_NOIO); memset(ctx, 0, conf->ctx_size); -- 2.51.0