From e59ac513fb2410e6c2eca9658283a89a89b1de4e Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Tue, 12 Mar 2019 13:04:44 -0700 Subject: [PATCH] rdma: remove reqs from read/write queues in error Not doing so can cause us to hit asserts during the shutdown path. This should fix an intermittent failure we are seeing on the test pool where we hit the assert rdma_req->state != RDMA_REQUEST_STATE_FREE in spdk_nvmf_rdma_request_process. Note that this problem doesn't cause any data corruption when debug is not enabled, it just causes us to probcess a subset of commands through the state machine one extra time suring qpair shutdown. Change-Id: Ibc36bfea87ec4089b8e2c7a915f48714fddb0b09 Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447843 Tested-by: SPDK CI Jenkins Reviewed-by: Darek Stojaczyk Reviewed-by: Shuhei Matsumoto Reviewed-by: Jim Harris --- lib/nvmf/rdma.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/nvmf/rdma.c b/lib/nvmf/rdma.c index e620d346ef..960203d894 100644 --- a/lib/nvmf/rdma.c +++ b/lib/nvmf/rdma.c @@ -1550,6 +1550,10 @@ spdk_nvmf_rdma_request_process(struct spdk_nvmf_rdma_transport *rtransport, if (rqpair->ibv_attr.qp_state == IBV_QPS_ERR || rqpair->qpair.state != SPDK_NVMF_QPAIR_ACTIVE) { if (rdma_req->state == RDMA_REQUEST_STATE_NEED_BUFFER) { TAILQ_REMOVE(&rgroup->pending_data_buf_queue, rdma_req, link); + } else if (rdma_req->state == RDMA_REQUEST_STATE_DATA_TRANSFER_TO_CONTROLLER_PENDING) { + STAILQ_REMOVE(&rqpair->pending_rdma_read_queue, rdma_req, spdk_nvmf_rdma_request, state_link); + } else if (rdma_req->state == RDMA_REQUEST_STATE_DATA_TRANSFER_TO_HOST_PENDING) { + STAILQ_REMOVE(&rqpair->pending_rdma_write_queue, rdma_req, spdk_nvmf_rdma_request, state_link); } rdma_req->state = RDMA_REQUEST_STATE_COMPLETED; }