Patch "nvme-tcp: rerun io_work if req_list is not empty" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    nvme-tcp: rerun io_work if req_list is not empty

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     nvme-tcp-rerun-io_work-if-req_list-is-not-empty.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 98f66ef836e53746ea23d1be342b3093c7d5daee
Author: Keith Busch <kbusch@xxxxxxxxxx>
Date:   Mon May 17 15:36:43 2021 -0700

    nvme-tcp: rerun io_work if req_list is not empty
    
    [ Upstream commit a0fdd1418007f83565d3f2e04b47923ba93a9b8c ]
    
    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: db5ad6b7f8cdd ("nvme-tcp: try to send request in queue_rq context")
    Signed-off-by: Keith Busch <kbusch@xxxxxxxxxx>
    Reviewed-by: Sagi Grimberg <sagi@xxxxxxxxxxx>
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index 4cf81f3841ae..7346a05d395b 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -1140,7 +1140,8 @@ static void nvme_tcp_io_work(struct work_struct *w)
 				pending = true;
 			else if (unlikely(result < 0))
 				break;
-		}
+		} else
+			pending = !llist_empty(&queue->req_list);
 
 		result = nvme_tcp_try_recv(queue);
 		if (result > 0)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux