public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sagi Grimberg <sagi@grimberg.me>, Daniel Wagner <dwagner@suse.de>,
	Christoph Hellwig <hch@lst.de>, Sasha Levin <sashal@kernel.org>,
	kbusch@kernel.org, axboe@fb.com, linux-nvme@lists.infradead.org
Subject: [PATCH AUTOSEL 5.18 20/22] nvme-tcp: always fail a request when sending it failed
Date: Wed,  6 Jul 2022 11:30:38 -0400	[thread overview]
Message-ID: <20220706153041.1597639-20-sashal@kernel.org> (raw)
In-Reply-To: <20220706153041.1597639-1-sashal@kernel.org>

From: Sagi Grimberg <sagi@grimberg.me>

[ Upstream commit 41d07df7de841bfbc32725ce21d933ad358f2844 ]

queue stoppage and inflight requests cancellation is fully fenced from
io_work and thus failing a request from this context. Hence we don't
need to try to guess from the socket retcode if this failure is because
the queue is about to be torn down or not.

We are perfectly safe to just fail it, the request will not be cancelled
later on.

This solves possible very long shutdown delays when the users issues a
'nvme disconnect-all'

Reported-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/nvme/host/tcp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index ad3a2bf2f1e9..e44d0570e694 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -1180,8 +1180,7 @@ static int nvme_tcp_try_send(struct nvme_tcp_queue *queue)
 	} else if (ret < 0) {
 		dev_err(queue->ctrl->ctrl.device,
 			"failed to send request %d\n", ret);
-		if (ret != -EPIPE && ret != -ECONNRESET)
-			nvme_tcp_fail_request(queue->request);
+		nvme_tcp_fail_request(queue->request);
 		nvme_tcp_done_send_req(queue);
 	}
 	return ret;
-- 
2.35.1


  parent reply	other threads:[~2022-07-06 15:32 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-06 15:30 [PATCH AUTOSEL 5.18 01/22] ksmbd: use SOCK_NONBLOCK type for kernel_accept() Sasha Levin
2022-07-06 15:30 ` [PATCH AUTOSEL 5.18 02/22] powerpc/xive/spapr: correct bitmap allocation size Sasha Levin
2022-07-06 15:30 ` [PATCH AUTOSEL 5.18 03/22] vdpa/mlx5: Initialize CVQ vringh only once Sasha Levin
2022-07-06 15:30 ` [PATCH AUTOSEL 5.18 04/22] vduse: Tie vduse mgmtdev and its device Sasha Levin
2022-07-06 15:30 ` [PATCH AUTOSEL 5.18 05/22] platform/x86: intel/pmc: Add Alder Lake N support to PMC core driver Sasha Levin
2022-07-06 15:30 ` [PATCH AUTOSEL 5.18 06/22] virtio_mmio: Add missing PM calls to freeze/restore Sasha Levin
2022-07-06 15:30 ` [PATCH AUTOSEL 5.18 07/22] virtio_mmio: Restore guest page size on resume Sasha Levin
2022-07-06 15:30 ` [PATCH AUTOSEL 5.18 08/22] netfilter: nf_tables: avoid skb access on nf_stolen Sasha Levin
2022-07-06 15:30 ` [PATCH AUTOSEL 5.18 09/22] netfilter: br_netfilter: do not skip all hooks with 0 priority Sasha Levin
2022-07-06 15:30 ` [PATCH AUTOSEL 5.18 10/22] scsi: hisi_sas: Limit max hw sectors for v3 HW Sasha Levin
2022-07-06 15:30 ` [PATCH AUTOSEL 5.18 11/22] cpufreq: pmac32-cpufreq: Fix refcount leak bug Sasha Levin
2022-07-06 15:30 ` [PATCH AUTOSEL 5.18 12/22] platform/x86: thinkpad-acpi: profile capabilities as integer Sasha Levin
2022-07-06 15:30 ` [PATCH AUTOSEL 5.18 13/22] platform/x86: thinkpad_acpi: do not use PSC mode on Intel platforms Sasha Levin
2022-07-06 15:30 ` [PATCH AUTOSEL 5.18 14/22] platform/x86: hp-wmi: Ignore Sanitization Mode event Sasha Levin
2022-07-06 15:30 ` [PATCH AUTOSEL 5.18 15/22] firmware: sysfb: Make sysfb_create_simplefb() return a pdev pointer Sasha Levin
2022-07-06 15:30 ` [PATCH AUTOSEL 5.18 16/22] firmware: sysfb: Add sysfb_disable() helper function Sasha Levin
2022-07-06 15:30 ` [PATCH AUTOSEL 5.18 17/22] fbdev: Disable sysfb device registration when removing conflicting FBs Sasha Levin
2022-07-06 15:30 ` [PATCH AUTOSEL 5.18 18/22] net: tipc: fix possible refcount leak in tipc_sk_create() Sasha Levin
2022-07-06 15:30 ` [PATCH AUTOSEL 5.18 19/22] NFC: nxp-nci: don't print header length mismatch on i2c error Sasha Levin
2022-07-06 15:30 ` Sasha Levin [this message]
2022-07-06 15:30 ` [PATCH AUTOSEL 5.18 21/22] nvme: fix regression when disconnect a recovering ctrl Sasha Levin
2022-07-06 15:30 ` [PATCH AUTOSEL 5.18 22/22] net: sfp: fix memory leak in sfp_probe() Sasha Levin

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=20220706153041.1597639-20-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=axboe@fb.com \
    --cc=dwagner@suse.de \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=stable@vger.kernel.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