summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSagi Grimberg <sagi@grimberg.me>2020-10-22 10:15:23 +0800
committerChristoph Hellwig <hch@lst.de>2020-11-03 10:26:02 +0100
commitfdf58e02adecbef4c7cbb2073d8ea225e6fd5f26 (patch)
treeeb032fc5a131694d1f17c870cb9be4eebbcf9d6e
parentd6f66210f4b1aa2f5944f0e34e0f8db44f499f92 (diff)
downloadlwn-fdf58e02adecbef4c7cbb2073d8ea225e6fd5f26.tar.gz
lwn-fdf58e02adecbef4c7cbb2073d8ea225e6fd5f26.zip
nvme-rdma: avoid repeated request completion
The request may be executed asynchronously, and rq->state may be changed to IDLE. To avoid repeated request completion, only MQ_RQ_COMPLETE of rq->state is checked in nvme_rdma_complete_timed_out. It is not safe, so need adding check IDLE for rq->state. Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Chao Leng <lengchao@huawei.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--drivers/nvme/host/rdma.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 83dbf2223125..75d071d34319 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -1975,7 +1975,7 @@ static void nvme_rdma_complete_timed_out(struct request *rq)
struct nvme_rdma_queue *queue = req->queue;
nvme_rdma_stop_queue(queue);
- if (!blk_mq_request_completed(rq)) {
+ if (blk_mq_request_started(rq) && !blk_mq_request_completed(rq)) {
nvme_req(rq)->status = NVME_SC_HOST_ABORTED_CMD;
blk_mq_complete_request(rq);
}