From: Daniel Wagner Date: Thu, 27 Jan 2022 10:06:39 +0000 (+0100) Subject: nvme: Call nvme_identify_*list with correct nsid offset X-Git-Tag: v2.0-rc2~2^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b5c01e4e3361dea5407d45e0e42c0b5ef00e5590;p=users%2Fsagi%2Fnvme-cli.git nvme: Call nvme_identify_*list with correct nsid offset Commit 81bb8289f642 ("nvme: update list-ns nsid option") changed the start index for the namespace argument. But the merge back from the monolithic branch was incomplete and missed to update the index offset when calling nvme_identify_allocated_ns_list and nvme_identify_active_ns_list. Signed-off-by: Daniel Wagner --- diff --git a/nvme.c b/nvme.c index c9376a1f..612c98a5 100644 --- a/nvme.c +++ b/nvme.c @@ -1965,10 +1965,10 @@ static int list_ns(int argc, char **argv, struct command *cmd, struct plugin *pl } if (cfg.all) - err = nvme_identify_allocated_ns_list(fd, cfg.namespace_id, + err = nvme_identify_allocated_ns_list(fd, cfg.namespace_id - 1, &ns_list); else - err = nvme_identify_active_ns_list(fd, cfg.namespace_id, + err = nvme_identify_active_ns_list(fd, cfg.namespace_id - 1, &ns_list); if (!err) nvme_show_list_ns(&ns_list, flags);