Commit a104c9f2 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

nvme-rdma: fix merge error

The merge of 4.12-rc5 into the for-4.13/block tree didn't handle the queue
ready case correctly.  Fix this by propagating blk_status_t into
nvme_rdma_queue_is_ready.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 8f66439e
...@@ -1435,8 +1435,8 @@ nvme_rdma_timeout(struct request *rq, bool reserved) ...@@ -1435,8 +1435,8 @@ nvme_rdma_timeout(struct request *rq, bool reserved)
/* /*
* We cannot accept any other command until the Connect command has completed. * We cannot accept any other command until the Connect command has completed.
*/ */
static inline int nvme_rdma_queue_is_ready(struct nvme_rdma_queue *queue, static inline blk_status_t
struct request *rq) nvme_rdma_queue_is_ready(struct nvme_rdma_queue *queue, struct request *rq)
{ {
if (unlikely(!test_bit(NVME_RDMA_Q_LIVE, &queue->flags))) { if (unlikely(!test_bit(NVME_RDMA_Q_LIVE, &queue->flags))) {
struct nvme_command *cmd = nvme_req(rq)->cmd; struct nvme_command *cmd = nvme_req(rq)->cmd;
...@@ -1452,9 +1452,8 @@ static inline int nvme_rdma_queue_is_ready(struct nvme_rdma_queue *queue, ...@@ -1452,9 +1452,8 @@ static inline int nvme_rdma_queue_is_ready(struct nvme_rdma_queue *queue,
* failover. * failover.
*/ */
if (queue->ctrl->ctrl.state == NVME_CTRL_RECONNECTING) if (queue->ctrl->ctrl.state == NVME_CTRL_RECONNECTING)
return -EIO; return BLK_STS_IOERR;
else return BLK_STS_RESOURCE; /* try again later */
return -EAGAIN;
} }
} }
...@@ -1479,7 +1478,7 @@ static blk_status_t nvme_rdma_queue_rq(struct blk_mq_hw_ctx *hctx, ...@@ -1479,7 +1478,7 @@ static blk_status_t nvme_rdma_queue_rq(struct blk_mq_hw_ctx *hctx,
ret = nvme_rdma_queue_is_ready(queue, rq); ret = nvme_rdma_queue_is_ready(queue, rq);
if (unlikely(ret)) if (unlikely(ret))
goto err; return ret;
dev = queue->device->dev; dev = queue->device->dev;
ib_dma_sync_single_for_cpu(dev, sqe->dma, ib_dma_sync_single_for_cpu(dev, sqe->dma,
......
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