summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Fomichev <dmitry.fomichev@wdc.com>2021-01-27 13:19:14 +0900
committerJens Axboe <axboe@kernel.dk>2021-01-29 08:14:00 -0700
commit8a866de7a310691ec9a93417225c9ff8d375bf16 (patch)
tree4a38dc37781cd65ac4524f7e7281f2c13374b403
parentbe7a6baed58f19df27bc4495573610b8301c98ae (diff)
downloadfio-8a866de7a310691ec9a93417225c9ff8d375bf16.tar.gz
fio-8a866de7a310691ec9a93417225c9ff8d375bf16.tar.bz2
zbd: skip offline zones in zbd_convert_to_open_zone()
Since all I/Os to an offline zone will fail, add a check in zbd_convert_to_open_zone() to ignore zones that have this condition. Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com> Reviewed-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--zbd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/zbd.c b/zbd.c
index 123b3908..019eaf62 100644
--- a/zbd.c
+++ b/zbd.c
@@ -1078,7 +1078,8 @@ static struct fio_zone_info *zbd_convert_to_open_zone(struct thread_data *td,
zone_lock(td, f, z);
pthread_mutex_lock(&f->zbd_info->mutex);
- if (td->o.max_open_zones == 0 && td->o.job_max_open_zones == 0)
+ if (z->cond != ZBD_ZONE_COND_OFFLINE &&
+ td->o.max_open_zones == 0 && td->o.job_max_open_zones == 0)
goto examine_zone;
if (f->zbd_info->num_open_zones == 0) {
dprint(FD_ZBD, "%s(%s): no zones are open\n",
@@ -1200,6 +1201,7 @@ out:
dprint(FD_ZBD, "%s(%s): returning zone %d\n", __func__, f->file_name,
zone_idx);
io_u->offset = z->start;
+ assert(z->cond != ZBD_ZONE_COND_OFFLINE);
return z;
}