]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
nvme-tcp: fix possible hang waiting for icresp response
authorSagi Grimberg <sagi@grimberg.me>
Thu, 23 Jul 2020 23:42:26 +0000 (16:42 -0700)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Fri, 4 Sep 2020 19:28:27 +0000 (16:28 -0300)
BugLink: https://bugs.launchpad.net/bugs/1891063
[ Upstream commit adc99fd378398f4c58798a1c57889872967d56a6 ]

If the controller died exactly when we are receiving icresp
we hang because icresp may never return. Make sure to set a
high finite limit.

Fixes: 3f2304f8c6d6 ("nvme-tcp: add NVMe over TCP host driver")
Signed-off-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: Ian May <ian.may@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/nvme/host/tcp.c

index 7900814355c285da3a59228cf6451e3c25aaeb00..53e113a18a549de7c96c9c16ba7f2a14de9a0bea 100644 (file)
@@ -1319,6 +1319,9 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl,
                }
        }
 
+       /* Set 10 seconds timeout for icresp recvmsg */
+       queue->sock->sk->sk_rcvtimeo = 10 * HZ;
+
        queue->sock->sk->sk_allocation = GFP_ATOMIC;
        if (!qid)
                n = 0;