From: Steven Seungcheol Lee Date: Mon, 29 Aug 2022 11:23:55 +0000 (+0900) Subject: zns.c: report zones should be started after retrieved zone X-Git-Tag: v2.2~41^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d44cd1560745e089737639c2f1ce953428fa1256;p=users%2Fsagi%2Fnvme-cli.git zns.c: report zones should be started after retrieved zone Signed-off-by: Steven Seungcheol Lee --- diff --git a/plugins/zns/zns.c b/plugins/zns/zns.c index ffa45eb1..f8809ba4 100644 --- a/plugins/zns/zns.c +++ b/plugins/zns/zns.c @@ -842,9 +842,8 @@ static int report_zones(int argc, char **argv, struct command *cmd, struct plugi int zdes = 0, err = -1; struct nvme_dev *dev; __u32 report_size; - void *report; bool huge = false; - struct nvme_zone_report *buff; + struct nvme_zone_report *report, *buff; unsigned int nr_zones_chunks = 1024, /* 1024 entries * 64 bytes per entry = 64k byte transfer */ nr_zones_retrieved = 0, @@ -999,7 +998,7 @@ static int report_zones(int argc, char **argv, struct command *cmd, struct plugi zdes, log_len, flags, zone_list); nr_zones_retrieved += nr_zones_chunks; - offset = (nr_zones_retrieved * zsze); + offset = le64_to_cpu(report->entries[nr_zones_chunks-1].zslba) + zsze; } if (flags & JSON)