nvme: fix error handling in nvme_ns_report_zones
authorChristoph Hellwig <hch@lst.de>
Sun, 30 Aug 2020 10:00:10 +0000 (12:00 +0200)
committerChristoph Hellwig <hch@lst.de>
Sun, 27 Sep 2020 07:14:19 +0000 (09:14 +0200)
commit936fab503ff4af94f5f9c0b549f3ab4d435500ec
tree2017adcbb8a5ad45fb2bbcc2c2a2e36f2e196fd3
parentddd3d1051797b9f907ab9799f5ba50398c530676
nvme: fix error handling in nvme_ns_report_zones

nvme_submit_sync_cmd can return positive NVMe error codes in addition to
the negative Linux error code, which are currently ignored.  Fix this
by removing __nvme_ns_report_zones and handling the errors from
nvme_submit_sync_cmd in the caller instead of multiplexing the return
value and the number of zones reported into a single return value.

Fixes: 240e6ee272c0 ("nvme: support for zoned namespaces")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
drivers/nvme/host/zns.c