Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13474435ybl; Sun, 29 Dec 2019 12:47:10 -0800 (PST) X-Google-Smtp-Source: APXvYqyqm0uaG8Rv+FCHdzCfVpTScBs4k3i4JYMVOD2Bjn/4ORDmFyBk3QyE0vxA0GblXmaC/PLC X-Received: by 2002:a9d:7592:: with SMTP id s18mr73200199otk.130.1577652430512; Sun, 29 Dec 2019 12:47:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577652430; cv=none; d=google.com; s=arc-20160816; b=MFB4oQpADjIEAmOBs4UxKAjea0aCXG2hRLn+d5SIuD3OJKGLmDvgM2J5a92hy0lVm5 tJk8vXtn4njUJ5tZNGlIxc9W2g4S+Hzpka0zFYcPP5v3YYmd3e8CThed0e6+a07wcxw8 WG+YI7CfS1Y5ByXd9/wCBh28nTeVLZGf3PanhkgoCaVU1ykESAr2cIZ7R423XEYTBSFn QMOVplXpx96ro7xXkvpv/LoPUiNRaRMcE/dWFmjkk7dKiThwWOgviXPkgDuATW5zRfv4 p+1cFIMAF/xP/NbNd+yZd/obrtjWvSuKSEywxedgih71ulAmlwcvOI+OZRD9OtnlicyF HsCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nyB6Nk2eFyOSA9H9ThW7NP8d6sEZoa+kdlAs6/cwoiU=; b=E1vBZEb6Rt0WC1yKS3TXUwFzjobETghV64Dgr50VD7IP4aU52KBaMhic+fiCCmr9Dn UhzLk0nTJ+9EALo9XAEl/k2/SeqcGGYwjZVIPzNz16v4VV35EsjhC/wJ5ctsS95E61JC aJl5NEHsS2/SfQD8k3qCBS0jZM/eOaeCikUpSsOuYNxVqdDLOa5zJ7pIdnaFFojySK6B Dts44n+h4+9N5bkYIYfqhd+mLlMGgJL+DlU8OxJGVTu/1yA8rDZeKsc8N4ILC9n+tFiQ 55kfE8rPAkQwP6Dw+kG9IeEWrj3vb6EXKjASDgKa5r45lgU8N5Q/S1P1D5WEmAN4TtFP PZlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=K4BZDb39; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g10si21888321otn.12.2019.12.29.12.46.59; Sun, 29 Dec 2019 12:47:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=K4BZDb39; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731920AbfL2Ruk (ORCPT + 99 others); Sun, 29 Dec 2019 12:50:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:35236 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731145AbfL2Rui (ORCPT ); Sun, 29 Dec 2019 12:50:38 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DFADA208C4; Sun, 29 Dec 2019 17:50:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641838; bh=jdNtSF3EYMlYf03kSIiNuT+bTGIm2CtTN/3ghGpQl1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K4BZDb39nUDjljQwtwWO26WdfMiHB1+NBgBIuG0YrDEFNDeEqNkZtK+rOoCQ7hIwG U61x3C6DSAHg1gb43JGzH9wM3aFM/rfpr+9u8oDYdb/1vPvkAYRdBxaUXQVhrL0Pbz JcSpbzs7Txd7RFE+d1oiIXfpZuZb6AAUkd47HdRE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Max Gurtovoy , Christoph Hellwig , Keith Busch , Jens Axboe , Sasha Levin Subject: [PATCH 5.4 230/434] nvme: introduce "Command Aborted By host" status code Date: Sun, 29 Dec 2019 18:24:43 +0100 Message-Id: <20191229172717.146191150@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Max Gurtovoy [ Upstream commit 2dc3947b53f573e8a75ea9cbec5588df88ca502e ] Fix the status code of canceled requests initiated by the host according to TP4028 (Status Code 0x371): "Command Aborted By host: The command was aborted as a result of host action (e.g., the host disconnected the Fabric connection)." Also in a multipath environment, unless otherwise specified, errors of this type (path related) should be retried using a different path, if one is available. Signed-off-by: Max Gurtovoy Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/nvme/host/core.c | 2 +- drivers/nvme/host/multipath.c | 1 + include/linux/nvme.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index af3212aec871..b4e1e4379f1f 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -313,7 +313,7 @@ bool nvme_cancel_request(struct request *req, void *data, bool reserved) if (blk_mq_request_completed(req)) return true; - nvme_req(req)->status = NVME_SC_HOST_PATH_ERROR; + nvme_req(req)->status = NVME_SC_HOST_ABORTED_CMD; blk_mq_complete_request(req); return true; } diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index e0f064dcbd02..132ade51ee87 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -95,6 +95,7 @@ void nvme_failover_req(struct request *req) } break; case NVME_SC_HOST_PATH_ERROR: + case NVME_SC_HOST_ABORTED_CMD: /* * Temporary transport disruption in talking to the controller. * Try to send on a new path. diff --git a/include/linux/nvme.h b/include/linux/nvme.h index f61d6906e59d..a260cd754f28 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h @@ -1368,6 +1368,7 @@ enum { NVME_SC_ANA_INACCESSIBLE = 0x302, NVME_SC_ANA_TRANSITION = 0x303, NVME_SC_HOST_PATH_ERROR = 0x370, + NVME_SC_HOST_ABORTED_CMD = 0x371, NVME_SC_CRD = 0x1800, NVME_SC_DNR = 0x4000, -- 2.20.1