Spdk/examples/nvme
Niklas Cassel 1e83b640aa examples/nvme_fio_plugin: fix zone reporting
All zone management receive helper functions (including
spdk_nvme_zns_report_zones()) are implemented to match the parameters of
the zone management receive function in the ZNS specification.

The documentation for spdk_nvme_zns_report_zones() states:
"param partial_report If true, nr_zones field in the zone report indicates
the number of zone descriptors that were successfully written to the zone
report. If false, nr_zones field in the zone report indicates the number
of zone descriptors that match the report_opts criteria."
This matches the description of the "Partial Report" bit in the ZNS spec.

Since the FIO function parse_zone_info() calls the io_ops->report_zones()
function multiple times, until all zones have been reported, it expects
the return from this function to represent the number of zones that were
successfully reported.

By setting the partial_report bit to false, the controller will return
the total number of zones, and since spdk_fio_report_zones() loops until
idx < report->nr_zones, and writes to zbdz[idx], the current code will
overwrite heap memory, since idx will take on index values that are out
of bounds for the memory allocated by the FIO function parse_zone_info().

Therefore, spdk_fio_report_zones() has to set the partial_report bit to
true when calling the NVMe level function spdk_nvme_zns_report_zones().

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I8846711bfed4faadac0315b450158293cefa36f4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4871
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Simon A. F. Lund <simon.lund@samsung.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-10-28 15:07:37 +00:00
..
abort examples/nvme: Use spdk_nvme_detach_async() and spdk_nvme_detach_poll_async() 2020-10-20 16:55:55 +00:00
arbitration examples/nvme: Use spdk_nvme_detach_async() and spdk_nvme_detach_poll_async() 2020-10-20 16:55:55 +00:00
cmb_copy nvme/cmb_copy: disable submission queue in CMB 2020-04-22 09:18:22 +00:00
fio_plugin examples/nvme_fio_plugin: fix zone reporting 2020-10-28 15:07:37 +00:00
hello_world examples/nvme/hello_world: call exit() on read error 2020-10-23 13:47:09 +00:00
hotplug build: fix duplicate spdk.common.mk includes 2019-05-22 14:51:01 +00:00
identify examples/nvme/identify: print ZNS data structures if supported 2020-10-28 15:07:10 +00:00
nvme_manage examples/nvme: Use spdk_nvme_detach_async() and spdk_nvme_detach_poll_async() 2020-10-20 16:55:55 +00:00
perf examples/nvme: Use spdk_nvme_detach_async() and spdk_nvme_detach_poll_async() 2020-10-20 16:55:55 +00:00
reconnect examples/nvme: Use spdk_nvme_detach_async() and spdk_nvme_detach_poll_async() 2020-10-20 16:55:55 +00:00
Makefile example/nvme: add application to test NVMe I/O abort 2020-07-17 07:21:13 +00:00