summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Le Moal <damien.lemoal@wdc.com>2019-08-30 10:45:03 +0900
committerJens Axboe <axboe@kernel.dk>2019-08-29 19:52:30 -0600
commitfc52e44996fd74ee43520acbab81f0cf3206a30d (patch)
tree70a4ca951df6bc82b8ff3a68e8ca08851ec1e5a7
parentc012becd449b5bcb8a885a3938e7e38737d9aafe (diff)
downloadfio-fc52e44996fd74ee43520acbab81f0cf3206a30d.tar.gz
fio-fc52e44996fd74ee43520acbab81f0cf3206a30d.tar.bz2
zbd: Fix job zone size initialization
For a job accessing a zoned block device, the zone size is automatically initialized to the device zone size. However, since zone information for a zoned block device is parsed once only for the first job initialization of a multi job workload, only the first job has its zonesize option intialized, causing problem if the zoneskip option is also used (assert exit). Fix this by always initializing a job zonesize option using the job file zbd information when verifying the job ZBD related sizes and offsets. Fixes: 4d37720ae029 ("zbd: Add support for zoneskip option") Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--zbd.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/zbd.c b/zbd.c
index fb81b532..0a573692 100644
--- a/zbd.c
+++ b/zbd.c
@@ -120,6 +120,15 @@ static bool zbd_verify_sizes(void)
if (!zbd_is_seq_job(f))
continue;
+ if (!td->o.zone_size) {
+ td->o.zone_size = f->zbd_info->zone_size;
+ if (!td->o.zone_size) {
+ log_err("%s: invalid 0 zone size\n",
+ f->file_name);
+ return false;
+ }
+ }
+
if (td->o.zone_skip &&
(td->o.zone_skip < td->o.zone_size ||
td->o.zone_skip % td->o.zone_size)) {