zbd: Fix missing mutex unlock and warnings detected with coverity
authorDamien Le Moal <damien.lemoal@wdc.com>
Wed, 8 Apr 2020 06:46:45 +0000 (15:46 +0900)
committerJens Axboe <axboe@kernel.dk>
Wed, 8 Apr 2020 14:43:32 +0000 (08:43 -0600)
commitadc6adcb7b43d8cb228ac05d56e3d4f849b5226e
tree5ebd228ffc1aea67d4c07502e094f457bdba8abc
parent9d87c646c45227c86c5a15faee2a6717a4bf1b46
zbd: Fix missing mutex unlock and warnings detected with coverity

With max_open_zones != 0, if no candidate zone for open is found by
zbd_convert_to_open_zone(), the file zbd_info mutex as well as the
current target zone mutex must both be unlocked before returning NULL.

While at it, also assert check for min_bs != 0 where min_bs is used for
divisions to avoid division by zero warnings from coverity.

Reported-by: Bart Van Assche <bvanassche@acm.org>
Fixes: 6463db6c1d3a ("fio: fix interaction between offset/size...")
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
zbd.c