> + unsigned int nr_zones; > int ret; > > if (!argp) > @@ -355,8 +356,9 @@ int blkdev_report_zones_ioctl(struct block_device *bdev, fmode_t mode, > if (!rep.nr_zones) > return -EINVAL; > > - if (rep.nr_zones > INT_MAX / sizeof(struct blk_zone)) > - return -ERANGE; > + nr_zones = blkdev_nr_zones(bdev); > + if (rep.nr_zones > nr_zones) > + rep.nr_zones = nr_zones; This could be further simplified using min_t, but othewise it looks fine to me: Reviewed-by: Christoph Hellwig <hch@xxxxxx> -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel