diff options
author | Keith Busch <keith.busch@intel.com> | 2018-01-09 12:04:14 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-01-10 10:52:12 -0700 |
commit | e96fef2c3fa396dda680e943dddaa4f2a06e7b1c (patch) | |
tree | 953a10268ebb771f45454aea01002bca70304b77 | |
parent | fcd36c36f381f534adad5a6c6485db4405d5ea42 (diff) | |
download | linux-stable-e96fef2c3fa396dda680e943dddaa4f2a06e7b1c.tar.gz linux-stable-e96fef2c3fa396dda680e943dddaa4f2a06e7b1c.tar.bz2 linux-stable-e96fef2c3fa396dda680e943dddaa4f2a06e7b1c.zip |
nvme: Add more command status translation
This adds more NVMe status code translations to blk_status_t values,
and captures all the current status codes NVMe multipath uses.
Acked-by: Mike Snitzer <snitzer@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | drivers/nvme/host/core.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 2bcd49584f71..d8956d94cbd8 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -157,13 +157,20 @@ static blk_status_t nvme_error_status(struct request *req) return BLK_STS_OK; case NVME_SC_CAP_EXCEEDED: return BLK_STS_NOSPC; + case NVME_SC_LBA_RANGE: + return BLK_STS_TARGET; + case NVME_SC_BAD_ATTRIBUTES: case NVME_SC_ONCS_NOT_SUPPORTED: + case NVME_SC_INVALID_OPCODE: + case NVME_SC_INVALID_FIELD: + case NVME_SC_INVALID_NS: return BLK_STS_NOTSUPP; case NVME_SC_WRITE_FAULT: case NVME_SC_READ_ERROR: case NVME_SC_UNWRITTEN_BLOCK: case NVME_SC_ACCESS_DENIED: case NVME_SC_READ_ONLY: + case NVME_SC_COMPARE_FAILED: return BLK_STS_MEDIUM; case NVME_SC_GUARD_CHECK: case NVME_SC_APPTAG_CHECK: |