From: John Levon Date: Thu, 9 Jun 2022 16:32:26 +0000 (+0000) Subject: submit_io(): fix "nvme compare" to pass correct command X-Git-Tag: v2.1-rc0~36^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9b6d3fca4289;p=users%2Fsagi%2Fnvme-cli.git submit_io(): fix "nvme compare" to pass correct command Since "18de3a6d Convert to libnvme", an "nvme compare" was being converted incorrectly into an "nvme write" in submit_io(). Signed-off-by: John Levon --- diff --git a/nvme.c b/nvme.c index 217a8e00..38c865bf 100644 --- 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);