]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
submit_io(): fix "nvme compare" to pass correct command
authorJohn Levon <john.levon@nutanix.com>
Thu, 9 Jun 2022 16:32:26 +0000 (16:32 +0000)
committerDaniel Wagner <dwagner@suse.de>
Mon, 13 Jun 2022 07:06:07 +0000 (09:06 +0200)
Since "18de3a6d Convert to libnvme", an "nvme compare" was being
converted incorrectly into an "nvme write" in submit_io().

Signed-off-by: John Levon <john.levon@nutanix.com>
nvme.c

diff --git a/nvme.c b/nvme.c
index 217a8e000f40bc335cab5d6e3c9b8094d9c841ff..38c865bfb0728f3dd7e967a1e5c98bce496c8ed3 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -6602,7 +6602,9 @@ static int submit_io(int opcode, char *command, const char *desc,
                .result         = NULL,
        };
        gettimeofday(&start_time, NULL);
-       if (opcode & 1)
+       if (opcode == nvme_cmd_compare)
+               err = nvme_compare(&args);
+       else if (opcode & 1)
                err = nvme_write(&args);
        else
                err = nvme_read(&args);