iolog: Fix write_iolog_close()
authorDamien Le Moal <damien.lemoal@wdc.com>
Fri, 8 May 2020 07:56:39 +0000 (16:56 +0900)
committerJens Axboe <axboe@kernel.dk>
Fri, 15 May 2020 13:41:32 +0000 (07:41 -0600)
commitd087d28fc4ed967836f561884e4154d2c437a9d5
tree82a54c9dfc31f849780eab52804a0c04f0043e48
parent723f9bc5fe77ae8bedc08ed3ec3a25426b48c096
iolog: Fix write_iolog_close()

If the init_iolog() call from backend.c thread_main() fails (e.g. wrong
file path given), td->iolog_f is not set but write_iolog_close() is
still called from thread_main() error processing. This causes a seg
fault and unclean termination of fio. Fix this by changing
write_iolog_close() to do nothing if td->iolog_f is NULL.

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