Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: skip unnecessary checks for split bio

Lots of checks are already done while submitting this bio the first
time, and there is no need to check them again when this bio is
resubmitted after split.

Hence open code should_fail_bio() and blk_throtl_bio() that are still
necessary from submit_bio_split_bioset().

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Yu Kuai and committed by
Jens Axboe
0b64682e e3290419

+7 -2
+1 -1
block/blk-core.c
··· 539 539 } 540 540 } 541 541 542 - static noinline int should_fail_bio(struct bio *bio) 542 + int should_fail_bio(struct bio *bio) 543 543 { 544 544 if (should_fail_request(bdev_whole(bio->bi_bdev), bio->bi_iter.bi_size)) 545 545 return -EIO;
+5 -1
block/blk-merge.c
··· 130 130 bio_chain(split, bio); 131 131 trace_block_split(split, bio->bi_iter.bi_sector); 132 132 WARN_ON_ONCE(bio_zone_write_plugging(bio)); 133 - submit_bio_noacct(bio); 133 + 134 + if (should_fail_bio(bio)) 135 + bio_io_error(bio); 136 + else if (!blk_throtl_bio(bio)) 137 + submit_bio_noacct_nocheck(bio); 134 138 135 139 return split; 136 140 }
+1
block/blk.h
··· 616 616 int disk_register_independent_access_ranges(struct gendisk *disk); 617 617 void disk_unregister_independent_access_ranges(struct gendisk *disk); 618 618 619 + int should_fail_bio(struct bio *bio); 619 620 #ifdef CONFIG_FAIL_MAKE_REQUEST 620 621 bool should_fail_request(struct block_device *part, unsigned int bytes); 621 622 #else /* CONFIG_FAIL_MAKE_REQUEST */