Re: [dm-devel] [PATCH v4 03/11] scsi: sd_zbc: Fix sd_zbc_check_zones() error checks

2018-10-17 Thread Christoph Hellwig
> @@ -687,12 +688,8 @@ int sd_zbc_read_zones(struct scsi_disk *sdkp, unsigned > char *buf) >* Check zone size: only devices with a constant zone size (except >* an eventual last runt zone) that is a power of 2 are supported. >*/ > - zone_blocks =

Re: [dm-devel] [PATCH v4 03/11] scsi: sd_zbc: Fix sd_zbc_check_zones() error checks

2018-10-15 Thread Martin K. Petersen
Damien, > The unsigned 32 bits overflow check for the zone size value is already > done within sd_zbc_check_zones() with the test: > > } else if (logical_to_sectors(sdkp->device, zone_blocks) > UINT_MAX) { > > so there is no need to check again for an out of range value in >

Re: [dm-devel] [PATCH v4 03/11] scsi: sd_zbc: Fix sd_zbc_check_zones() error checks

2018-10-12 Thread Damien Le Moal
On 2018/10/12 19:23, Hannes Reinecke wrote: > On 10/12/18 12:08 PM, Damien Le Moal wrote: >> The unsigned 32 bits overflow check for the zone size value is already >> done within sd_zbc_check_zones() with the test: >> >> } else if (logical_to_sectors(sdkp->device, zone_blocks) > UINT_MAX) { >> >>

Re: [dm-devel] [PATCH v4 03/11] scsi: sd_zbc: Fix sd_zbc_check_zones() error checks

2018-10-12 Thread Hannes Reinecke
On 10/12/18 12:08 PM, Damien Le Moal wrote: The unsigned 32 bits overflow check for the zone size value is already done within sd_zbc_check_zones() with the test: } else if (logical_to_sectors(sdkp->device, zone_blocks) > UINT_MAX) { so there is no need to check again for an out of range value