[PATCH v2] nvme-core: initialize status to NVME_SC_HOST_PATH_ERROR
Keith Busch
kbusch at kernel.org
Thu Apr 15 20:30:30 BST 2021
On Wed, Apr 14, 2021 at 11:08:33AM -0600, Yuanyuan Zhong wrote:
> Block layer blk_end_sync_rq() silently drops blk_status_t error.
> When ->queue_rq returns error, nvme driver should set nvme status
> explicitly. Otherwise the passthrough command may take the stale
> status as result. A typical value zero will be interpreted as
> NVME_SC_SUCCESS, despite the dispatching error from ->queue_rq.
>
> Instead of trying to fix it for every error return, this change
> initialize the status to NVME_SC_HOST_PATH_ERROR during
> nvme_clear_nvme_request().
It doesn't look like these types of errors are unique to nvme. Could we
not just have blk_execute_rq() return an error instead?
More information about the Linux-nvme
mailing list