]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-tcp: rerun io_work if req_list is not empty
authorKeith Busch <kbusch@kernel.org>
Mon, 17 May 2021 22:36:43 +0000 (15:36 -0700)
committerChristoph Hellwig <hch@lst.de>
Wed, 19 May 2021 06:33:42 +0000 (08:33 +0200)
commit93c663b707fff732067a42db7aa911811cc484cb
treef605ad8eb9589ecf11e75d8c1b0853b99ba74749
parente768b78848fd7a838a539a8bbdf6ba8986057dad
nvme-tcp: rerun io_work if req_list is not empty

A possible race condition exists where the request to send data is
enqueued from nvme_tcp_handle_r2t()'s will not be observed by
nvme_tcp_send_all() if it happens to be running. The driver relies on
io_work to send the enqueued request when it is runs again, but the
concurrently running nvme_tcp_send_all() may not have released the
send_mutex at that time. If no future commands are enqueued to re-kick
the io_work, the request will timeout in the SEND_H2C state, resulting
in a timeout error like:

  nvme nvme0: queue 1: timeout request 0x3 type 6

Ensure the io_work continues to run as long as the req_list is not empty.

Fixes: 58375c17a5690 ("nvme-tcp: try to send request in queue_rq context")
Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/tcp.c