]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Revert "nvme: add flush command chardev handle error message"
authorDaniel Wagner <wagi@kernel.org>
Fri, 7 Feb 2025 13:53:29 +0000 (14:53 +0100)
committerDaniel Wagner <wagi@monom.org>
Tue, 11 Feb 2025 11:23:46 +0000 (12:23 +0100)
This reverts commit 946029cf58d2b039a20c0c96dba7e6ef636070f9.

Causes regression in nightly CI runs. The problem couldn't be figured out
thus revert it.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
nvme.c

diff --git a/nvme.c b/nvme.c
index 233b2dc563515dc98bb7ebae022637262d1942bd..1e7083a360016eb2519971ed7fe76edbdd5e0f76 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -7465,23 +7465,6 @@ static int copy_cmd(int argc, char **argv, struct command *cmd, struct plugin *p
        return err;
 }
 
-static void io_cmd_show_error(struct nvme_dev *dev, int err, const char *cmd)
-{
-       if (err > 0) {
-               nvme_show_status(err);
-               return;
-       }
-
-       nvme_show_init();
-
-       nvme_show_error("%s: %s", cmd, nvme_strerror(errno));
-
-       if (is_chardev(dev))
-               nvme_show_result("char device provided but blkdev is needed, e.g. /dev/nvme0n1");
-
-       nvme_show_finish();
-}
-
 static int flush_cmd(int argc, char **argv, struct command *cmd, struct plugin *plugin)
 {
        const char *desc = "Commit data and metadata associated with\n"
@@ -7517,8 +7500,10 @@ static int flush_cmd(int argc, char **argv, struct command *cmd, struct plugin *
        }
 
        err = nvme_flush(dev_fd(dev), cfg.namespace_id);
-       if (err)
-               io_cmd_show_error(dev, err, "flush");
+       if (err < 0)
+               nvme_show_error("flush: %s", nvme_strerror(errno));
+       else if (err != 0)
+               nvme_show_status(err);
        else
                printf("NVMe Flush: success\n");