zbd: Fix max_open_zones checks
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Wed, 27 May 2020 01:20:13 +0000 (10:20 +0900)
committerJens Axboe <axboe@kernel.dk>
Thu, 4 Jun 2020 02:15:35 +0000 (20:15 -0600)
commit00ca8df5468e90bbf1256ec90fc9ae14b1706ccc
treeed44553268be09a73f5fa548ea88c62a2ea2a2dc
parent63a4b9cca4ba3aa4101051402cbbe946ced17a49
zbd: Fix max_open_zones checks

Commit 219c662d3b12 ("zbd: introduce per job maximum open zones limit")
introduced job_max_open_zones option which limits the number of open
zones per job. It has similar role as max_open_zones option which limits
the number of open zones for all jobs. It was intended that these two
options both work, but the commit replaced some checks for max_open_zones
simply with checks for job_max_open_zones. Because of this, when
max_open_zones is set and job_max_open_zones is not set, fio fails to
limit the number of open zones. This resulted in test case #29 failure
of t/zbd/test-zbd-support script for regular null_blk devices.

To fix the failure, modify the checks to target both job_max_open_zones
and max_open_zones.

Fixes: 219c662d3b12 ("zbd: introduce per job maximum open zones limit")
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
zbd.c