Message ID | 20190702174236.3332-5-chaitanya.kulkarni@wdc.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | block: use right accessor to read nr_sects | expand |
On 19-07-02 10:42:30, Chaitanya Kulkarni wrote: > 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(). Chaitanya, Are the first three patches split for a special reason? IMHO, it could be squashed into a single one. It looks good to me, by the way. Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
On 7/2/19 5:23 PM, Minwoo Im wrote: > On 19-07-02 10:42:30, Chaitanya Kulkarni wrote: >> 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(). > Chaitanya, > > Are the first three patches split for a special reason? IMHO, it could > be squashed into a single one. > > It looks good to me, by the way. In the blk-zoned.c in this way it is easier to bisect if/when the problem comes. > > Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com> >
On 19-07-03 02:29:33, Chaitanya Kulkarni wrote: > On 7/2/19 5:23 PM, Minwoo Im wrote: > > On 19-07-02 10:42:30, Chaitanya Kulkarni wrote: > >> 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(). > > Chaitanya, > > > > Are the first three patches split for a special reason? IMHO, it could > > be squashed into a single one. > > > > It looks good to me, by the way. > > In the blk-zoned.c in this way it is easier to bisect if/when the problem > > comes. Oh okay. That makes sense. Thanks, Chaitanya.
diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 9faf4488339d..e7f2874b5d37 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -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(). Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> --- block/blk-zoned.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)