init: return error incase an invalid value is passed as option
authorAnuj Gupta <anuj20.g@samsung.com>
Tue, 31 May 2022 13:31:49 +0000 (19:01 +0530)
committerJens Axboe <axboe@kernel.dk>
Thu, 2 Jun 2022 08:19:41 +0000 (02:19 -0600)
Currently, fio exits incase an invalid value is passed as fio
option, but continues even if an invalid value is passed for
I/O engine specific options. Exit in that scenario.

Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
Link: https://lore.kernel.org/r/20220531133155.17493-4-ankit.kumar@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
init.c

diff --git a/init.c b/init.c
index f7d702f849c7c39797912c8d7774b0fc6dccf908..da8007760a5f321f779c2c61e4d8297af6e29ffb 100644 (file)
--- a/init.c
+++ b/init.c
@@ -2810,6 +2810,15 @@ int parse_cmd_line(int argc, char *argv[], int client_type)
                                break;
 
                        ret = fio_cmd_ioengine_option_parse(td, opt, val);
+
+                       if (ret) {
+                               if (td) {
+                                       put_job(td);
+                                       td = NULL;
+                               }
+                               do_exit++;
+                               exit_val = 1;
+                       }
                        break;
                }
                case 'w':