diff options
author | Shaun Tancheff <shaun@tancheff.com> | 2016-11-21 22:52:23 +0100 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-11-21 23:08:24 +0100 |
commit | 778889d8412e36e666b1e4ce108373613c84b428 (patch) | |
tree | 09f6a7ab673ed4be84f3f296ffd8c4e0d4f6c770 /block/blk-core.c | |
parent | block: clear all of bi_opf in bio_set_op_attrs (diff) | |
download | linux-778889d8412e36e666b1e4ce108373613c84b428.tar.xz linux-778889d8412e36e666b1e4ce108373613c84b428.zip |
block: apply blk_partition_remap to REQ_OP_ZONE_RESET
If a ZBC device is partitioned and operations are performed on the partition
the zone information is rebased to the partition, however the zone reset
is not mapped from the partition to device as are other operations.
This causes the API (report zones / reset zone) to be unbalanced in this
regard. Checking for the zone reset op code explicitly will balance the
API.
Signed-off-by: Shaun Tancheff <shaun.tancheff@seagate.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 473dd698effd..6c4a425690fc 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1787,7 +1787,12 @@ static inline void blk_partition_remap(struct bio *bio) { struct block_device *bdev = bio->bi_bdev; - if (bio_sectors(bio) && bdev != bdev->bd_contains) { + /* + * Zone reset does not include bi_size so bio_sectors() is always 0. + * Include a test for the reset op code and perform the remap if needed. + */ + if (bdev != bdev->bd_contains && + (bio_sectors(bio) || bio_op(bio) == REQ_OP_ZONE_RESET)) { struct hd_struct *p = bdev->bd_part; bio->bi_iter.bi_sector += p->start_sect; |