zbd: fix zonemode=zbd with NDEBUG
authorAlexey Dobriyan <adobriyan@gmail.com>
Fri, 10 Apr 2020 19:06:21 +0000 (22:06 +0300)
committerJens Axboe <axboe@kernel.dk>
Mon, 13 Apr 2020 14:19:46 +0000 (08:19 -0600)
assert() with NDEBUG doesn't evaluate argument.

Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Alexey Dobriyan (SK hynix) <adobriyan@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
zbd.c

diff --git a/zbd.c b/zbd.c
index 0b0d4f40cbaecea5bee5e758e1489d9f871e4fbe..aa1fa33fe903171bc14b9053c2b73d9a3357b7dc 100644 (file)
--- a/zbd.c
+++ b/zbd.c
@@ -1220,6 +1220,7 @@ static void zbd_put_io(const struct io_u *io_u)
        struct zoned_block_device_info *zbd_info = f->zbd_info;
        struct fio_zone_info *z;
        uint32_t zone_idx;
+       int ret;
 
        if (!zbd_info)
                return;
@@ -1235,7 +1236,8 @@ static void zbd_put_io(const struct io_u *io_u)
               "%s: terminate I/O (%lld, %llu) for zone %u\n",
               f->file_name, io_u->offset, io_u->buflen, zone_idx);
 
-       assert(pthread_mutex_unlock(&z->mutex) == 0);
+       ret = pthread_mutex_unlock(&z->mutex);
+       assert(ret == 0);
        zbd_check_swd(f);
 }