diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/dm.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index d85adec43fe8..e38d1d7d17d6 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1152,7 +1152,8 @@ static int clone_bio(struct dm_target_io *tio, struct bio *bio, return r; } - bio_advance(clone, to_bytes(sector - clone->bi_iter.bi_sector)); + if (bio_op(bio) != REQ_OP_ZONE_REPORT) + bio_advance(clone, to_bytes(sector - clone->bi_iter.bi_sector)); clone->bi_iter.bi_size = to_bytes(len); if (unlikely(bio_integrity(bio) != NULL)) @@ -1341,7 +1342,11 @@ static int __split_and_process_non_flush(struct clone_info *ci) if (!dm_target_is_valid(ti)) return -EIO; - len = min_t(sector_t, max_io_len(ci->sector, ti), ci->sector_count); + if (bio_op(bio) == REQ_OP_ZONE_REPORT) + len = ci->sector_count; + else + len = min_t(sector_t, max_io_len(ci->sector, ti), + ci->sector_count); r = __clone_and_map_data_bio(ci, ti, ci->sector, &len); if (r < 0) |