]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Nov 2020 18:22:12 +0000 (19:22 +0100)
commit987a99014200c1d2e9edddeebe37bfe9168cdb9b
treed0e97de739f413be0a192d0ca5005a463b073dfd
parentc28eec9faf89f938bf55dadcad570d3c05595fde
nvme-rdma: avoid race between time out and tear down

[ Upstream commit 3017013dcc82a4862bd1e140f8b762cfc594008d ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/rdma.c