diff options
Diffstat (limited to 'drivers/md/dm-verity.c')
-rw-r--r-- | drivers/md/dm-verity.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/dm-verity.c b/drivers/md/dm-verity.c index a746f1d21c6..b948fd864d4 100644 --- a/drivers/md/dm-verity.c +++ b/drivers/md/dm-verity.c @@ -501,7 +501,7 @@ static int verity_map(struct dm_target *ti, struct bio *bio) return -EIO; } - if ((bio->bi_sector + bio_sectors(bio)) >> + if (bio_end_sector(bio) >> (v->data_dev_block_bits - SECTOR_SHIFT) > v->data_blocks) { DMERR_LIMIT("io out of range"); return -EIO; @@ -519,7 +519,7 @@ static int verity_map(struct dm_target *ti, struct bio *bio) bio->bi_end_io = verity_end_io; bio->bi_private = io; - io->io_vec_size = bio->bi_vcnt - bio->bi_idx; + io->io_vec_size = bio_segments(bio); if (io->io_vec_size < DM_VERITY_IO_VEC_INLINE) io->io_vec = io->io_vec_inline; else |