summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host/lightnvm.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-04-20 16:02:58 +0200
committerJens Axboe <axboe@fb.com>2017-04-20 12:16:10 -0600
commit65ba6b54e7c1fe7751388f5da6ad87c2d1bee3ae (patch)
tree3937ee6dc83ce4d1a5430c60de37a71881a0bcd9 /drivers/nvme/host/lightnvm.c
parent27fa9bc54541dabc3fabe1c520d342f5add0379b (diff)
downloadlinux-65ba6b54e7c1fe7751388f5da6ad87c2d1bee3ae.tar.bz2
nvme: make nvme_error_status private
Currently it's used by the lighnvm passthrough ioctl, but we'd like to make it private in preparation of block layer specific error code. Lighnvm already returns the real NVMe status anyway, so I think we can just limit it to returning -EIO for any status set. This will need a careful audit from the lightnvm folks, though. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme/host/lightnvm.c')
-rw-r--r--drivers/nvme/host/lightnvm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c
index cb599b3fc12c..de61a4a03d78 100644
--- a/drivers/nvme/host/lightnvm.c
+++ b/drivers/nvme/host/lightnvm.c
@@ -595,7 +595,7 @@ static int nvme_nvm_submit_user_cmd(struct request_queue *q,
__le64 *metadata = NULL;
dma_addr_t metadata_dma;
DECLARE_COMPLETION_ONSTACK(wait);
- int ret;
+ int ret = 0;
rq = nvme_alloc_request(q, (struct nvme_command *)vcmd, 0,
NVME_QID_ANY);
@@ -667,8 +667,8 @@ submit:
if (nvme_req(rq)->flags & NVME_REQ_CANCELLED)
ret = -EINTR;
- else
- ret = nvme_error_status(rq);
+ else if (nvme_req(rq)->status & 0x7ff)
+ ret = -EIO;
if (result)
*result = nvme_req(rq)->status & 0x7ff;
if (status)