Skip to content

Commit

Permalink
brd: remove the end of device check in brd_do_bvec
Browse files Browse the repository at this point in the history
The block layer already checks for this conditions in bio_check_eod
before calling the driver.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Jan 25, 2021
1 parent d11cd28 commit 74cb899
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/block/brd.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,14 +285,10 @@ static int brd_do_bvec(struct brd_device *brd, struct page *page,
static blk_qc_t brd_submit_bio(struct bio *bio)
{
struct brd_device *brd = bio->bi_disk->private_data;
sector_t sector = bio->bi_iter.bi_sector;
struct bio_vec bvec;
sector_t sector;
struct bvec_iter iter;

sector = bio->bi_iter.bi_sector;
if (bio_end_sector(bio) > get_capacity(bio->bi_disk))
goto io_error;

bio_for_each_segment(bvec, bio, iter) {
unsigned int len = bvec.bv_len;
int err;
Expand Down

0 comments on commit 74cb899

Please sign in to comment.