For a zone size that is not a power of 2, f->zbd_info->zone_size_log2 is set to -1. So use bit shift in zbd_zone_idx() only if zone_size_log2 is not negative. Signed-off-by: Damien Le Moal <damien.lemoal@xxxxxxx> Reviewed-by: Bart Van Assche <bvanassche@xxxxxxx> --- zbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zbd.c b/zbd.c index 93f14410..eb474f6e 100644 --- a/zbd.c +++ b/zbd.c @@ -31,7 +31,7 @@ static uint32_t zbd_zone_idx(const struct fio_file *f, uint64_t offset) { uint32_t zone_idx; - if (f->zbd_info->zone_size_log2) + if (f->zbd_info->zone_size_log2 > 0) zone_idx = offset >> f->zbd_info->zone_size_log2; else zone_idx = (offset >> 9) / f->zbd_info->zone_size; -- 2.17.1