From: Shin'ichiro Kawasaki Date: Wed, 19 Jul 2023 10:57:45 +0000 (+0900) Subject: zbd: write to closed zones on the devices with max_active_zones limit X-Git-Tag: fio-3.36~56 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=bab838f806eb139b1ffece82454df77d9b6be233;p=fio.git zbd: write to closed zones on the devices with max_active_zones limit Current fio implementation does not handle zones in closed condition as write target zones. When the device has max_active_zones limit, the write to other zones may cause errors by exceeding the limit, since the zones in closed condition consume the device resource for the max_active_zones limit. To avoid the error, handle the zones in closed condition as write target in same manner as the zones in open condition when the device has the max_active_zones limit. At the job start, check each condition of the zones in the IO ranges and if it has closed condition, pass the zone to zbd_write_zones_get() in same manner as the zones in open condition. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Niklas Cassel Link: https://lore.kernel.org/r/20230719105756.553146-3-shinichiro.kawasaki@wdc.com Signed-off-by: Vincent Fu --- diff --git a/zbd.c b/zbd.c index a5cb34d2..b05d2360 100644 --- a/zbd.c +++ b/zbd.c @@ -1276,7 +1276,11 @@ int zbd_setup_files(struct thread_data *td) for (zi = f->min_zone; zi < f->max_zone; zi++) { z = &zbd->zone_info[zi]; if (z->cond != ZBD_ZONE_COND_IMP_OPEN && - z->cond != ZBD_ZONE_COND_EXP_OPEN) + z->cond != ZBD_ZONE_COND_EXP_OPEN && + z->cond != ZBD_ZONE_COND_CLOSED) + continue; + if (!zbd->max_active_zones && + z->cond == ZBD_ZONE_COND_CLOSED) continue; if (__zbd_write_zone_get(td, f, z)) continue;