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

Keith Busch <[email protected]>
Newsgroups org.infradead.lists.linux-nvme
Message-ID <akv6nYVwUXvUOqC8@kbusch-mbp>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.