Commit e02ab023 authored by Junxiong Guan's avatar Junxiong Guan Committed by Christoph Hellwig

nvme: let dm-mpath distinguish nvme error codes

Currently most IOs which return the nvme error codes are retried on
the other path if those IOs returns EIO from NVMe driver. This
patch let Multipath distinguish nvme media error codes and some
generic or cmd-specific nvme error codes so that multipath will
not retry those kinds of IO, to save bandwidth.
Signed-off-by: default avatarJunxiong Guan <guanjunxiong@huawei.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 7776db1c
...@@ -75,6 +75,20 @@ static int nvme_error_status(struct request *req) ...@@ -75,6 +75,20 @@ static int nvme_error_status(struct request *req)
return -ENOSPC; return -ENOSPC;
default: default:
return -EIO; return -EIO;
/*
* XXX: these errors are a nasty side-band protocol to
* drivers/md/dm-mpath.c:noretry_error() that aren't documented
* anywhere..
*/
case NVME_SC_CMD_SEQ_ERROR:
return -EILSEQ;
case NVME_SC_ONCS_NOT_SUPPORTED:
return -EOPNOTSUPP;
case NVME_SC_WRITE_FAULT:
case NVME_SC_READ_ERROR:
case NVME_SC_UNWRITTEN_BLOCK:
return -ENODATA;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment