Skip to content

Commit adc99fd

Browse files
sagigrimbergChristoph Hellwig
authored andcommitted
nvme-tcp: fix possible hang waiting for icresp response
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: 3f2304f ("nvme-tcp: add NVMe over TCP host driver") Signed-off-by: Sagi Grimberg <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 1f273e2 commit adc99fd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/nvme/host/tcp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,6 +1382,9 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl,
13821382
if (nctrl->opts->tos >= 0)
13831383
ip_sock_set_tos(queue->sock->sk, nctrl->opts->tos);
13841384

1385+
/* Set 10 seconds timeout for icresp recvmsg */
1386+
queue->sock->sk->sk_rcvtimeo = 10 * HZ;
1387+
13851388
queue->sock->sk->sk_allocation = GFP_ATOMIC;
13861389
nvme_tcp_set_queue_io_cpu(queue);
13871390
queue->request = NULL;

0 commit comments

Comments
 (0)