zbd: Improve job zonesize initialization checks
authorDamien Le Moal <damien.lemoal@wdc.com>
Fri, 30 Aug 2019 02:16:05 +0000 (11:16 +0900)
committerJens Axboe <axboe@kernel.dk>
Fri, 30 Aug 2019 02:51:17 +0000 (20:51 -0600)
For a multijob workload, each job may specify a zonesize option for
access to a zoned block device or regular device with zonemode=zbd.
In such case, make sure that the zone size value specified by each job
matches the device zone size.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
zbd.c

diff --git a/zbd.c b/zbd.c
index 0a57369..99310c4 100644 (file)
--- a/zbd.c
+++ b/zbd.c
@@ -127,6 +127,11 @@ static bool zbd_verify_sizes(void)
                                                f->file_name);
                                        return false;
                                }
+                       } else if (td->o.zone_size != f->zbd_info->zone_size) {
+                               log_err("%s: job parameter zonesize %llu does not match disk zone size %llu.\n",
+                                       f->file_name, (unsigned long long) td->o.zone_size,
+                                       (unsigned long long) f->zbd_info->zone_size);
+                               return false;
                        }
 
                        if (td->o.zone_skip &&