From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC4D1C432C0 for ; Tue, 26 Nov 2019 13:37:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8D4B8206BF for ; Tue, 26 Nov 2019 13:37:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oZQCeDHW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8D4B8206BF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=EzFc3qbFIAB2zN1NG1NbPAZsWHi1dTlNVOG8G5jghjQ=; b=oZQ CeDHWrs747PDDnOuvWColjhIUG4rkmtvRsCmlahcZ6lpp6AZJZjrpCJVZ2nj3W2lYBuSGMupQFfZo efyssHcnMj3xIii/66N+0zaKUU26ExY1B/Bjx3lfReq8AkVS3UwGfAYhbkL0DhJ75eTUMpVe5hkkv NKAb6PBQxutrBZEpMSZjKllE939J/VbwVvnOqb6nVURtBbQhpn0JQ72qWyFxjxV8xM95hmVrxxJBd 4BLbpub9/kDzZH7bhMIaeQkRCkiDDqvqDwvVy51dyRtyjykNc1ljFJBGAN8R3pH8olmqw7Gd1WjNA xc78CdMvavlQAkrezW2XP1PYbs61SdA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iZb2Q-0000LZ-B4; Tue, 26 Nov 2019 13:37:54 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iZb2O-00005s-Ba for linux-nvme@lists.infradead.org; Tue, 26 Nov 2019 13:37:53 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 1F1D7AB98; Tue, 26 Nov 2019 13:37:51 +0000 (UTC) From: Hannes Reinecke To: Christoph Hellwig Subject: [PATCH] nvme: always treat DNR status as no-retryable Date: Tue, 26 Nov 2019 14:37:49 +0100 Message-Id: <20191126133749.72267-1-hare@suse.de> X-Mailer: git-send-email 2.16.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191126_053752_553454_BF8531DC X-CRM114-Status: GOOD ( 10.86 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Keith Busch , Sagi Grimberg , linux-nvme@lists.infradead.org, Hannes Reinecke MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org If the DNR bit is set in the command status we should not retry the command, irrespective of what the actual status is. So map it directly to BLK_STS_TARGET to inform upper layers to not retry the command, not even on another path. Signed-off-by: Hannes Reinecke --- drivers/nvme/host/core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 752a40daf2b3..f015f6e91c85 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -198,6 +198,9 @@ static inline bool nvme_ns_has_pi(struct nvme_ns *ns) static blk_status_t nvme_error_status(u16 status) { + if (status & NVME_SC_DNR) + return BLK_STS_TARGET; + switch (status & 0x7ff) { case NVME_SC_SUCCESS: return BLK_STS_OK; -- 2.16.4 _______________________________________________ linux-nvme mailing list linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme