Blob Blame History Raw
From: Sagi Grimberg <sagi@grimberg.me>
Date: Mon, 23 Mar 2020 16:43:52 -0700
Subject: [PATCH] nvme-tcp: don't poll a non-live queue
Git-commit: f86e5bf817a57c7e6538dafee2fc65a525bb9935
Patch-mainline: v5.7-rc1
References: jsc#SLE-15608

In error recovery we might be removing the queue so check we
can actually poll before we do.

Reported-by: Mark Wunderlich <mark.wunderlich@intel.com>
Tested-by: Mark Wunderlich <mark.wunderlich@intel.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Hannes Reinecke <hare@suse.com>
---
 drivers/nvme/host/tcp.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -2299,6 +2299,9 @@ static int nvme_tcp_poll(struct blk_mq_h
 	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);