From patchwork Tue Jan 9 19:04:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 10153079 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B0B89603ED for ; Tue, 9 Jan 2018 19:01:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A98EE28477 for ; Tue, 9 Jan 2018 19:01:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9DB1D286E1; Tue, 9 Jan 2018 19:01:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C29528477 for ; Tue, 9 Jan 2018 19:01:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935112AbeAITBJ (ORCPT ); Tue, 9 Jan 2018 14:01:09 -0500 Received: from mga07.intel.com ([134.134.136.100]:20227 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935111AbeAITBI (ORCPT ); Tue, 9 Jan 2018 14:01:08 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jan 2018 11:01:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,336,1511856000"; d="scan'208";a="9948978" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.44]) by orsmga006.jf.intel.com with ESMTP; 09 Jan 2018 11:01:07 -0800 From: Keith Busch To: Linux Block , Linux NVMe , Device Mapper , Christoph Hellwig , Mike Snitzer , Jens Axboe Cc: Bart VanAssche , James Smart , "Martin K . Petersen" , Hannes Reinecke , Sagi Grimberg , Keith Busch Subject: [PATCHv2 4/5] nvme/multipath: Use blk_path_error Date: Tue, 9 Jan 2018 12:04:17 -0700 Message-Id: <20180109190418.7123-5-keith.busch@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180109190418.7123-1-keith.busch@intel.com> References: <20180109190418.7123-1-keith.busch@intel.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Uses common code for determining if an error should be retried on alternate path. Acked-by: Mike Snitzer Reviewed-by: Hannes Reinecke Signed-off-by: Keith Busch Reviewed-by: Johannes Thumshirn --- drivers/nvme/host/multipath.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index ae9abb600c0f..3b211d9e58b8 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -37,19 +37,7 @@ bool nvme_req_needs_failover(struct request *req, blk_status_t error) { if (!(req->cmd_flags & REQ_NVME_MPATH)) return false; - - switch (error) { - case BLK_STS_NOTSUPP: - case BLK_STS_NOSPC: - case BLK_STS_TARGET: - case BLK_STS_NEXUS: - case BLK_STS_MEDIUM: - case BLK_STS_PROTECTION: - return false; - } - - /* Everything else could be a path failure, so should be retried */ - return true; + return blk_path_error(error); } void nvme_kick_requeue_lists(struct nvme_ctrl *ctrl)