diff options
author | Chao Leng <lengchao@huawei.com> | 2021-01-14 17:09:26 +0800 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2021-01-18 18:58:18 +0100 |
commit | 9ebbfe495ecd2e51bc92ac21ed5817c3b9e223ce (patch) | |
tree | 9f6c7565605aed2003cd1054c29ed86952efb5a3 /drivers/regulator/s2mps11.c | |
parent | 7674073b2ed35ac951a49c425dec6b39d5a57140 (diff) |
nvme-tcp: avoid request double completion for concurrent nvme_tcp_timeout
Each name space has a request queue, if complete request long time,
multi request queues may have time out requests at the same time,
nvme_tcp_timeout will execute concurrently. Multi requests in different
request queues may be queued in the same tcp queue, multi
nvme_tcp_timeout may call nvme_tcp_stop_queue at the same time.
The first nvme_tcp_stop_queue will clear NVME_TCP_Q_LIVE and continue
stopping the tcp queue(cancel io_work), but the others check
NVME_TCP_Q_LIVE is already cleared, and then directly complete the
requests, complete request before the io work is completely canceled may
lead to a use-after-free condition.
Add a multex lock to serialize nvme_tcp_stop_queue.
Signed-off-by: Chao Leng <lengchao@huawei.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/regulator/s2mps11.c')
0 files changed, 0 insertions, 0 deletions