]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
nvme-tcp: avoid race between time out and tear down
authorChao Leng <lengchao@huawei.com>
Thu, 22 Oct 2020 02:15:15 +0000 (10:15 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 10 Dec 2020 11:06:23 +0000 (12:06 +0100)
commitd4aae761c2cbe37b5fb2060c27d5bcf94dc33b4b
treebae5f856aa5bc4549f12249068fe8d3c180b7f1b
parent2ee5ca8e95359c33a016c084c20692f6b130d9f0
nvme-tcp: avoid race between time out and tear down

BugLink: https://bugs.launchpad.net/bugs/1905618
[ Upstream commit d6f66210f4b1aa2f5944f0e34e0f8db44f499f92 ]

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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/nvme/host/tcp.c