Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagi@grimberg.me>
To: linux-nvme@lists.infradead.org, Christoph Hellwig <hch@lst.de>,
	Keith Busch <kbusch@kernel.org>,
	Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
Subject: [PATCH 1/7] nvme-tcp: fix bogus request completion when failing to send AER
Date: Mon, 14 Feb 2022 11:07:26 +0200	[thread overview]
Message-ID: <20220214090732.479193-2-sagi@grimberg.me> (raw)
In-Reply-To: <20220214090732.479193-1-sagi@grimberg.me>

AER is not backed by a real request, hence we should not incorrectly
assume that when failing to send a nvme command, it is a normal request
but rather check if this is an aer and if so complete the aer (similar
to the normal completion path).

Cc: stable@vger.kernel.org
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
---
 drivers/nvme/host/tcp.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index 01e24b5703db..1096a0b0a268 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -913,7 +913,15 @@ static inline void nvme_tcp_done_send_req(struct nvme_tcp_queue *queue)
 
 static void nvme_tcp_fail_request(struct nvme_tcp_request *req)
 {
-	nvme_tcp_end_request(blk_mq_rq_from_pdu(req), NVME_SC_HOST_PATH_ERROR);
+	if (nvme_tcp_async_req(req)) {
+		union nvme_result res = {};
+
+		nvme_complete_async_event(&req->queue->ctrl->ctrl,
+			NVME_SC_HOST_PATH_ERROR, &res);
+	} else {
+		nvme_tcp_end_request(blk_mq_rq_from_pdu(req),
+				NVME_SC_HOST_PATH_ERROR);
+	}
 }
 
 static int nvme_tcp_try_send_data(struct nvme_tcp_request *req)
-- 
2.30.2



  reply	other threads:[~2022-02-14  9:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-14  9:07 [PATCH 0/7] nvme: cleanup ida_simple_[get|remove] Sagi Grimberg
2022-02-14  9:07 ` Sagi Grimberg [this message]
2022-02-14 10:52   ` [PATCH 1/7] nvme-tcp: fix bogus request completion when failing to send AER Chaitanya Kulkarni
2022-02-14 10:59     ` Sagi Grimberg
2022-02-14  9:07 ` [PATCH 2/7] nvme: replace ida_simple[get|remove] with the simler ida_[alloc|free] Sagi Grimberg
2022-02-14  9:07 ` [PATCH 3/7] nvme-fc: " Sagi Grimberg
2022-02-14  9:07 ` [PATCH 4/7] nvmet: " Sagi Grimberg
2022-02-14  9:07 ` [PATCH 5/7] nvmet-fc: " Sagi Grimberg
2022-02-14  9:07 ` [PATCH 6/7] nvmet-rdma: " Sagi Grimberg
2022-02-14  9:07 ` [PATCH 7/7] nvmet-tcp: " Sagi Grimberg
2022-02-14 10:03 ` [PATCH 0/7] nvme: cleanup ida_simple_[get|remove] Chaitanya Kulkarni
2022-02-14 10:22   ` Sagi Grimberg
2022-02-14 10:44     ` Chaitanya Kulkarni
2022-02-14 10:59       ` Sagi Grimberg
2022-02-15 18:42         ` Christoph Hellwig
2022-02-15 19:15           ` Chaitanya Kulkarni
2022-02-15 19:27           ` Keith Busch
2022-02-15 20:01             ` Chaitanya Kulkarni
2022-02-16  8:02 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220214090732.479193-2-sagi@grimberg.me \
    --to=sagi@grimberg.me \
    --cc=Chaitanya.Kulkarni@wdc.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox