From 7ca9fd5bc03e2217dbc196931b6fedc8608141eb Mon Sep 17 00:00:00 2001 From: Ruozhu Li Date: Wed, 18 Nov 2020 10:07:19 +0800 Subject: [PATCH] nvme-rdma: fix crash casue by destroy id while resolving addr driver inclusion category: bugfix bugzilla: NA CVE: NA Link: https://gitee.com/openeuler/kernel/issues/I1WGZE ------------------------------------------------- when nvme_rdma_wait_for_cm timeout happened before resolve addr timeout, we will destroy id while still resolving addr, this will cause a crash. so change wait for cm timeout to double amount of resolve addr timeout. Signed-off-by: Ruozhu Li Reviewed-by: Chao Leng Reviewed-by: Jike Cheng Signed-off-by: Lijie Acked-by: Hanjun Guo Signed-off-by: Yang Yingliang --- drivers/nvme/host/rdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index 9f75dc17e345..fb10ad82c5e9 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -240,7 +240,7 @@ static void nvme_rdma_qp_event(struct ib_event *event, void *context) static int nvme_rdma_wait_for_cm(struct nvme_rdma_queue *queue) { wait_for_completion_interruptible_timeout(&queue->cm_done, - msecs_to_jiffies(NVME_RDMA_CONNECT_TIMEOUT_MS) + 1); + msecs_to_jiffies(2 * NVME_RDMA_CONNECT_TIMEOUT_MS)); return queue->cm_error; } -- GitLab