aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/brd.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-01-24 11:02:32 +0100
committerJens Axboe <axboe@kernel.dk>2021-01-24 18:17:20 -0700
commit74cb8994b22ad7b95ac38dad9c9609ae49e88ec1 (patch)
treec738105086e89ddfd44e3b6af75284494b853537 /drivers/block/brd.c
parentnvme: allow revalidate to set a namespace read-only (diff)
downloadlinux-dev-74cb8994b22ad7b95ac38dad9c9609ae49e88ec1.tar.xz
linux-dev-74cb8994b22ad7b95ac38dad9c9609ae49e88ec1.zip
brd: remove the end of device check in brd_do_bvec
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>
Diffstat (limited to 'drivers/block/brd.c')
-rw-r--r--drivers/block/brd.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index c43a6ab4b1f3..c7c821419079 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -285,14 +285,10 @@ out:
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;