Thread (5 messages) 5 messages, 3 authors, 2021-01-18

Re: [PATCH v2 1/2] nvme-rdma: avoid request double completion for concurrent nvme_rdma_timeout

From: Israel Rukshin <hidden>
Date: 2021-01-14 16:34:56

On 1/14/2021 11:09 AM, Chao Leng wrote:
A crash happens when inject completing request long time(nearly 30s).
Each name space has a request queue, when inject completing request long
time, multi request queues may have time out requests at the same time,
nvme_rdma_timeout will execute concurrently. Multi requests in different
request queues may be queued in the same rdma queue, multi
nvme_rdma_timeout may call nvme_rdma_stop_queue at the same time.
The first nvme_rdma_timeout will clear NVME_RDMA_Q_LIVE and continue
stopping the rdma queue(drain qp), but the others check NVME_RDMA_Q_LIVE
is already cleared, and then directly complete the requests, complete
request before the qp is fully drained may lead to a use-after-free
condition.

Add a multex lock to serialize nvme_rdma_stop_queue.
Looks good to me.

I tested this patch at our regression.

Tested-by: Israel Rukshin <redacted>
Reviewed-by: Israel Rukshin <redacted>


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help