Skip to content

Commit 49fe954

Browse files
sagigrimberggregkh
authored andcommitted
nvme-tcp: fix possible hang waiting for icresp response
[ Upstream commit adc99fd ] 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 <sagi@grimberg.me> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent cc77fa8 commit 49fe954

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎drivers/nvme/host/tcp.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,6 +1392,9 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl,
13921392
}
13931393
}
13941394

1395+
/* Set 10 seconds timeout for icresp recvmsg */
1396+
queue->sock->sk->sk_rcvtimeo = 10 * HZ;
1397+
13951398
queue->sock->sk->sk_allocation = GFP_ATOMIC;
13961399
nvme_tcp_set_queue_io_cpu(queue);
13971400
queue->request = NULL;

0 commit comments

Comments
 (0)