From: Steven Seungcheol Lee Date: Mon, 7 Mar 2022 09:51:11 +0000 (+0900) Subject: nvme: nvme write bug fix (no parse for option) X-Git-Tag: v2.0-rc6~9^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=41629846709d92a570bf17b8c8ddf71bbd1a4fb9;p=users%2Fsagi%2Fnvme-cli.git nvme: nvme write bug fix (no parse for option) occured from 0adb8c2c79df953bbef9e08ce684239a5650638f write command always print below error data size not provided Signed-off-by: Steven Seungcheol Lee --- diff --git a/nvme.c b/nvme.c index bbaee051..cc099ec0 100644 --- a/nvme.c +++ b/nvme.c @@ -6137,17 +6137,23 @@ static int submit_io(int opcode, char *command, const char *desc, if (fd < 0) goto ret; } else { + err = argconfig_parse(argc, argv, desc, opts); + if (err) + goto ret; err = fd = open_exclusive(argc, argv, cfg.force); - if (errno == EBUSY) { - fprintf(stderr, "Failed to open %s.\n", - basename(argv[optind])); - fprintf(stderr, - "Namespace is currently busy.\n"); - if (!cfg.force) + if (err < 0) { + if (errno == EBUSY) { + fprintf(stderr, "Failed to open %s.\n", + basename(argv[optind])); fprintf(stderr, - "Use the force [--force] option to ignore that.\n"); - } else { - argconfig_print_help(desc, opts); + "Namespace is currently busy.\n"); + if (!cfg.force) + fprintf(stderr, + "Use the force [--force] option to ignore that.\n"); + } else { + argconfig_print_help(desc, opts); + } + goto ret; } }