|
@@ -1787,7 +1787,12 @@ static inline void blk_partition_remap(struct bio *bio)
|
|
{
|
|
{
|
|
struct block_device *bdev = bio->bi_bdev;
|
|
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;
|
|
struct hd_struct *p = bdev->bd_part;
|
|
|
|
|
|
bio->bi_iter.bi_sector += p->start_sect;
|
|
bio->bi_iter.bi_sector += p->start_sect;
|