nvmet: report backend transport errors as path errors
Subsystems (2)
PATCH 1/1 nvmet: report backend transport errors as path errors
The block backend maps BLK_STS_TRANSPORT to NVME_SC_INTERNAL with DNR set. This discards the backend's transport error classification. A Linux native multipath host completes the request before considering path failover, even if another controller can still access the namespace.
Map BLK_STS_TRANSPORT to NVME_SC_INTERNAL_PATH_ERROR without DNR instead. The transport failure is behind the controller, so report an internal path error rather than a host path error. Associate the error log entry with the namespace, as for the existing access-denied status.
This allows otherwise retryable native multipath requests to reach path error handling.
---
OpenAI Codex assisted with the code analysis, patch and changelog.
drivers/nvme/target/io-cmd-bdev.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/nvme/target/io-cmd-bdev.c +4 -0
@@ -167,6 +167,10 @@ u16 blk_to_nvme_status(struct nvmet_req *req, blk_status_t blk_sts) status =NVME_SC_ACCESS_DENIED ; req->error_loc = offsetof(struct nvme_rw_command , nsid);break ; +case BLK_STS_TRANSPORT : + status =NVME_SC_INTERNAL_PATH_ERROR ; + req->error_loc = offsetof(struct nvme_rw_command , nsid); +break ;case BLK_STS_IOERR :default : status =NVME_SC_INTERNAL |NVME_STATUS_DNR ;
base-commit: 7e1392a42ea288d70a266f6553fe06f57f8647ea
Signature · 1 line
2.56.0
Quoted 5 lines · Gleb Chesnokov
The block backend maps
BLK_STS_TRANSPORTtoNVME_SC_INTERNALwith DNR set. This discards the backend's transport error classification. A Linux native multipath host completes the request before considering path failover, even if another controller can still access the namespace.
Quoted 7 lines
Map
BLK_STS_TRANSPORTtoNVME_SC_INTERNAL_PATH_ERRORwithout DNR instead. The transport failure is behind the controller, so report an internal path error rather than a host path error. Associate the error log entry with the namespace, as for the existing access-denied status.This allows otherwise retryable native multipath requests to reach path error handling.
Looks good:
Quoted 11 lines · Gleb Chesnokov
The block backend maps
BLK_STS_TRANSPORTtoNVME_SC_INTERNALwith DNR set. This discards the backend's transport error classification. A Linux native multipath host completes the request before considering path failover, even if another controller can still access the namespace.Map
BLK_STS_TRANSPORTtoNVME_SC_INTERNAL_PATH_ERRORwithout DNR instead. The transport failure is behind the controller, so report an internal path error rather than a host path error. Associate the error log entry with the namespace, as for the existing access-denied status.[...]
Thanks, applied to nvme-7.5.
[1/1] nvmet: report backend transport errors as path errors
commit: 3b90e37012c0c5297ccbd7b531287b943c818bba
--
Keith Busch <[email protected]>