From: Sagi Grimberg Date: Mon, 23 Mar 2020 23:43:52 +0000 (-0700) Subject: nvme-tcp: don't poll a non-live queue X-Git-Tag: v5.10.7~2827^2~1^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f86e5bf817a57c7e6538dafee2fc65a525bb9935;p=platform%2Fkernel%2Flinux-rpi.git nvme-tcp: don't poll a non-live queue In error recovery we might be removing the queue so check we can actually poll before we do. Reported-by: Mark Wunderlich Tested-by: Mark Wunderlich Signed-off-by: Sagi Grimberg Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig --- diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index aa754ae..eb31c68 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -2299,6 +2299,9 @@ static int nvme_tcp_poll(struct blk_mq_hw_ctx *hctx) struct nvme_tcp_queue *queue = hctx->driver_data; struct sock *sk = queue->sock->sk; + if (!test_bit(NVME_TCP_Q_LIVE, &queue->flags)) + return 0; + if (sk_can_busy_loop(sk) && skb_queue_empty_lockless(&sk->sk_receive_queue)) sk_busy_loop(sk, true); nvme_tcp_try_recv(queue);