@@ -229,7 +229,7 @@ int blkdev_reset_zones(struct block_device *bdev,
if (bdev_read_only(bdev))
return -EPERM;
- if (!nr_sectors || end_sector > bdev->bd_part->nr_sects)
+ if (!nr_sectors || end_sector > bdev_nr_sects(bdev))
/* Out of range */
return -EINVAL;
@@ -239,7 +239,7 @@ int blkdev_reset_zones(struct block_device *bdev,
return -EINVAL;
if ((nr_sectors & (zone_sectors - 1)) &&
- end_sector != bdev->bd_part->nr_sects)
+ end_sector != bdev_nr_sects(bdev))
return -EINVAL;
blk_start_plug(&plug);
This patch updates the blkdev_reset_zones() with newly introduced helper function to read the nr_sects from block device's hd_parts with the help of part_nr_sects_read() protected by appropriate locking. Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> --- block/blk-zoned.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)