[PATCH] nvme: handle positive error codes in nuse_show()

Keith Busch kbusch at kernel.org
Mon Jul 6 11:57:33 PDT 2026


On Tue, Jun 30, 2026 at 10:27:17AM +0000, John Garry wrote:
> Function __nvme_submit_sync_cmd() returns a positive error code for NVMe
> errors. Otherwise, we get 0 for success or a negative error code for a
> kernel error.
> 
> In nuse_show() -> ns_{head}_update_nuse() -> nvme_identify_ns() ->
> nvme_submit_sync_cmd() -> __nvme_submit_sync_cmd(), we then may get a
> positive error code returned.
> 
> Function nuse_show() - being a device attr handler - should return the
> number of bytes written to the buffer or a negative error code.
> 
> Convert any positive NVMe error code to -EIO.

Thanks, applied to nvme-7.3.



More information about the Linux-nvme mailing list