]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
md/raid0: convert raid0_make_request() to use bio_submit_split_bioset()
authorYu Kuai <yukuai3@huawei.com>
Wed, 10 Sep 2025 06:30:56 +0000 (14:30 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 10 Sep 2025 11:23:46 +0000 (05:23 -0600)
Currently, raid0_make_request() will remap the original bio to underlying
disks to prevent reordered IO. Now that bio_submit_split_bioset() will put
original bio to the head of current->bio_list, it's safe converting to use
this helper and bio will still be ordered.

CC: Jan Kara <jack@suse.cz>
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/raid0.c

index ca08ec2e1f2742c3b8260d7d2100b401ce16a4db..adc9e68d064d9b0533cb87a72572a258c526cfad 100644 (file)
@@ -607,19 +607,10 @@ static bool raid0_make_request(struct mddev *mddev, struct bio *bio)
                 : sector_div(sector, chunk_sects));
 
        if (sectors < bio_sectors(bio)) {
-               struct bio *split = bio_split(bio, sectors, GFP_NOIO,
+               bio = bio_submit_split_bioset(bio, sectors,
                                              &mddev->bio_set);
-
-               if (IS_ERR(split)) {
-                       bio->bi_status = errno_to_blk_status(PTR_ERR(split));
-                       bio_endio(bio);
+               if (!bio)
                        return true;
-               }
-
-               bio_chain(split, bio);
-               trace_block_split(split, bio->bi_iter.bi_sector);
-               raid0_map_submit_bio(mddev, bio);
-               bio = split;
        }
 
        raid0_map_submit_bio(mddev, bio);