]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-rdma: avoid race between time out and tear down
authorChao Leng <lengchao@huawei.com>
Thu, 22 Oct 2020 02:15:08 +0000 (10:15 +0800)
committerChristoph Hellwig <hch@lst.de>
Tue, 3 Nov 2020 09:26:01 +0000 (10:26 +0100)
commit0f6313c8dd1ec8b38002d9cd37efd71e10f7d1fb
tree452c6ec98db330b2706ace48545a131dc31f39a4
parent92debc72ffcef013596056f41e74b1062ffc5ff8
nvme-rdma: avoid race between time out and tear down

Now use teardown_lock to serialize for time out and tear down. This may
cause abnormal: first cancel all request in tear down, then time out may
complete the request again, but the request may already be freed or
restarted.

To avoid race between time out and tear down, in tear down process,
first we quiesce the queue, and then delete the timer and cancel
the time out work for the queue. At the same time we need to delete
teardown_lock.

Signed-off-by: Chao Leng <lengchao@huawei.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/rdma.c