|
|
d6ab0e |
From 2459bd33b3dbb7a34f28c612d595311a6bc7593d Mon Sep 17 00:00:00 2001
|
|
|
d6ab0e |
From: Vincent Fu <vincent.fu@samsung.com>
|
|
|
d6ab0e |
Date: Wed, 4 Aug 2021 18:29:05 +0000
|
|
|
d6ab0e |
Subject: [PATCH] ioengines: fix crash with --enghelp option
|
|
|
d6ab0e |
|
|
|
d6ab0e |
Since f6931a1dd35896433c8cc2e10de51372a2c496c4 commands like the
|
|
|
d6ab0e |
following segfault:
|
|
|
d6ab0e |
|
|
|
d6ab0e |
fio --enghelp=sg
|
|
|
d6ab0e |
fio --enghelp=sg,sg_write_mode
|
|
|
d6ab0e |
|
|
|
d6ab0e |
This is because free_ioengine() assumes that td->io_ops is not NULL.
|
|
|
d6ab0e |
Make this true when free_ioengine() is called by
|
|
|
d6ab0e |
fio_show_ioengine_help() to avoid the crash.
|
|
|
d6ab0e |
|
|
|
d6ab0e |
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
|
|
|
d6ab0e |
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
|
d6ab0e |
---
|
|
|
d6ab0e |
ioengines.c | 10 +++++-----
|
|
|
d6ab0e |
1 file changed, 5 insertions(+), 5 deletions(-)
|
|
|
d6ab0e |
|
|
|
d6ab0e |
diff --git a/ioengines.c b/ioengines.c
|
|
|
d6ab0e |
index dd61af07..d08a511a 100644
|
|
|
d6ab0e |
--- a/ioengines.c
|
|
|
d6ab0e |
+++ b/ioengines.c
|
|
|
d6ab0e |
@@ -692,17 +692,17 @@ int fio_show_ioengine_help(const char *engine)
|
|
|
d6ab0e |
}
|
|
|
d6ab0e |
|
|
|
d6ab0e |
td.o.ioengine = (char *)engine;
|
|
|
d6ab0e |
- io_ops = load_ioengine(&td);
|
|
|
d6ab0e |
+ td.io_ops = load_ioengine(&td);
|
|
|
d6ab0e |
|
|
|
d6ab0e |
- if (!io_ops) {
|
|
|
d6ab0e |
+ if (!td.io_ops) {
|
|
|
d6ab0e |
log_info("IO engine %s not found\n", engine);
|
|
|
d6ab0e |
return 1;
|
|
|
d6ab0e |
}
|
|
|
d6ab0e |
|
|
|
d6ab0e |
- if (io_ops->options)
|
|
|
d6ab0e |
- ret = show_cmd_help(io_ops->options, sep);
|
|
|
d6ab0e |
+ if (td.io_ops->options)
|
|
|
d6ab0e |
+ ret = show_cmd_help(td.io_ops->options, sep);
|
|
|
d6ab0e |
else
|
|
|
d6ab0e |
- log_info("IO engine %s has no options\n", io_ops->name);
|
|
|
d6ab0e |
+ log_info("IO engine %s has no options\n", td.io_ops->name);
|
|
|
d6ab0e |
|
|
|
d6ab0e |
free_ioengine(&td);
|
|
|
d6ab0e |
return ret;
|
|
|
d6ab0e |
--
|
|
|
d6ab0e |
2.17.0
|
|
|
d6ab0e |
|