On 2020/04/07 4:56, Alexey Dobriyan wrote: > Code like this doesn't work if log2 is 0xffffffff. > > if (f->zbd_info->zone_size_log2 > 0) > zone_idx = offset >> f->zbd_info->zone_size_log2; > else > zone_idx = offset / f->zbd_info->zone_size; > > Other than that everything else works! > > Signed-off-by: Alexey Dobriyan (SK hynix) <adobriyan@xxxxxxxxx> Looks good. Reviewed-by: Damien Le Moal <damien.lemoal@xxxxxxx> > --- > > zbd.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > --- a/zbd.c > +++ b/zbd.c > @@ -393,7 +393,7 @@ static int init_zone_info(struct thread_data *td, struct fio_file *f) > f->zbd_info = zbd_info; > f->zbd_info->zone_size = zone_size; > f->zbd_info->zone_size_log2 = is_power_of_2(zone_size) ? > - ilog2(zone_size) : -1; > + ilog2(zone_size) : 0; > f->zbd_info->nr_zones = nr_zones; > pthread_mutexattr_destroy(&attr); > return 0; > @@ -510,7 +510,7 @@ static int parse_zone_info(struct thread_data *td, struct fio_file *f) > f->zbd_info = zbd_info; > f->zbd_info->zone_size = zone_size; > f->zbd_info->zone_size_log2 = is_power_of_2(zone_size) ? > - ilog2(zone_size) : -1; > + ilog2(zone_size) : 0; > f->zbd_info->nr_zones = nr_zones; > zbd_info = NULL; > ret = 0; > -- Damien Le Moal Western Digital Research