From 696f9850a786b718ecf0647deb53d37babca1906 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Fri, 7 Feb 2025 14:53:29 +0100 Subject: [PATCH] Revert "nvme: add flush command chardev handle error message" 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 --- nvme.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/nvme.c b/nvme.c index 233b2dc5..1e7083a3 100644 --- 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"); -- 2.50.1