stat: fix segfault with fio option --bandwidth-log
authorAnkit Kumar <ankit.kumar@samsung.com>
Fri, 21 Oct 2022 06:49:00 +0000 (12:19 +0530)
committerVincent Fu <vincent.fu@samsung.com>
Fri, 21 Oct 2022 17:23:41 +0000 (13:23 -0400)
commitd72244761b2230fbb2d6eaec59cdedd3ea651d4f
tree2292e5572d8a01424059075ed9cbe4f77aa2a426
parent548f1269e3772c666cac4148453d9c63bdfa65c4
stat: fix segfault with fio option --bandwidth-log

The log_params for aggregate read, write and trim only specify
log type. As a result the io_log doesn't have the relevant
thread_data structure. With fio option --bandwidth-log this results
in segmentation fault.
Add a check and use DEF_LOG_ENTRIES for such case.

Fixes: 0a852a50 ("fio: Introduce the log_entries option")
Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
[vkf: added Fixes tag, lightly edited commit message]
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
stat.c