Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4373737imw; Tue, 19 Jul 2022 05:34:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u1C/g3pA2gkSQHq2NJNTy5gBc3WRYNS4FJ4o2y06ApaUwDBygc8XdOQMiE2ZkHDQCFgGmF X-Received: by 2002:a17:907:7e87:b0:72b:4af3:bf57 with SMTP id qb7-20020a1709077e8700b0072b4af3bf57mr30721855ejc.9.1658234073612; Tue, 19 Jul 2022 05:34:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658234073; cv=none; d=google.com; s=arc-20160816; b=WndH/r1OxbyXc6EubnpUpALpONvUCbvE17bzpFAyC4yuzBg5W8GnwygGZ7OKj246LR nO7Felh31SN7ZCErhRHGwbeGjp696xWb/RMjPUg/iKhJglyS3gIT/YQt1f2wJs21K2bC Wv2UKAU75APRtK8al0kRDJIrevTvQWkqYOxRqA6cj6ZB79oqg8JT05jrADtTgl3vNA6Y mw0+z3FPoa7mZMQFe+D/QXlG+I7I7+UZCKcib1Xu/lXNqFr36gXBqVyxjZ0m0gD/LH+6 Bkb0fVjhg38G8fQSwh5r0IZnK9+klvoCLHJH9LjXJPmVh8iDB/PLXmOBOXdzISIK9Ytb mjYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=n6DW6kHcTot1J9H5lgaIcnAT0qRccPRnojSCbYRSWtk=; b=Q1eCW7VyFzlE8SbDDcNpRjDPqvE+VB/2hJ5WICs4wNYqeKyMLFbeTX3cY+VBeYqBE5 1BhpXI03FjD6HgaXaK7T/4bpr7Ua3/v5Md4cV2razEVySyAckAmIux9riFgDPVoCsR8j SdX+kJdWWOZzYO9nFH0TCOUeEYkfAMK7Abdo9Hf1lsRCMerohKL7X9YcfVIxwlg9OGWr +GoOaTrjV+3EvhA4LX38WRSVEHyPyefmf+bcWXpI+Rjw4uFiP6owbvnasqsxOZpsP5wU B7x26FxtoYI0oy54QNBYo8a9JTs2Wa0tpkQOkrkLxKQJas2jb7PSrcYePHXJRSvIIe/W /zew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VoU5Koc0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg23-20020a170907971700b007156fe1aa6asi19690699ejc.650.2022.07.19.05.34.07; Tue, 19 Jul 2022 05:34:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VoU5Koc0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240025AbiGSM0t (ORCPT + 99 others); Tue, 19 Jul 2022 08:26:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240089AbiGSMYc (ORCPT ); Tue, 19 Jul 2022 08:24:32 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE4F161D80; Tue, 19 Jul 2022 05:09:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 01A70CE1BE6; Tue, 19 Jul 2022 12:08:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0F52C341C6; Tue, 19 Jul 2022 12:08:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658232519; bh=/PBo5aChT/HITL0n8XQjCAQovVMDJHQ5AmS2ELAt8oo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VoU5Koc0IYCHHU4UzIV7MeDe59RIOMQfouLGslBmCen5tKo2JygY/x1/TiUVtvU6a mn8o7JuOy8j/pK0zC+mw8hV8l7jBJTNSLgxUDeMPFjMde4T/MY1m/aa4ib4o2JkBiB 9DwKfLwQtA11BiX+rdhZbNKiLESWBwOUxMHZ495A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Wagner , Sagi Grimberg , Christoph Hellwig , Sasha Levin Subject: [PATCH 5.10 085/112] nvme-tcp: always fail a request when sending it failed Date: Tue, 19 Jul 2022 13:54:18 +0200 Message-Id: <20220719114634.861288875@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114626.156073229@linuxfoundation.org> References: <20220719114626.156073229@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sagi Grimberg [ 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 Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- 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 7e3932033707..d5e162f2c23a 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -1149,8 +1149,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