From: hch@infradead.org (Christoph Hellwig)
Subject: [PATCH] nvme:let dm-mpath distinguish nvme error codes,no retry
Date: Thu, 20 Apr 2017 23:52:46 -0700 [thread overview]
Message-ID: <20170421065246.GA3817@infradead.org> (raw)
In-Reply-To: <1492521592-20648-1-git-send-email-guanjunxiong@huawei.com>
Hi Guang,
I'll need your Signed-off-by to apply this patch.
Also I'd like to update subject and comments a bit, are you fine with
the version below?
---
>From 7a252de505d4327a93fecf321c72691b14caa727 Mon Sep 17 00:00:00 2001
From: Junxiong Guan <guanjunxiong@huawei.com>
Date: Tue, 18 Apr 2017 21:19:52 +0800
Subject: nvme: let dm-mpath distinguish nvme error codes
Currently most IOs which return the nvme error codes are retried on
the other path if those IOs returns EIO from NVMe driver. This
patch let Multipath distinguish nvme media error codes and some
generic or cmd-specific nvme error codes so that multipath will
not retry those kinds of IO, to save bandwidth.
---
drivers/nvme/host/core.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 8dc664798293..263946b23628 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -75,6 +75,20 @@ static int nvme_error_status(struct request *req)
return -ENOSPC;
default:
return -EIO;
+
+ /*
+ * XXX: these errors are a nasty side-band protocol to
+ * drivers/md/dm-mpath.c:noretry_error() that aren't documented
+ * anywhere..
+ */
+ case NVME_SC_CMD_SEQ_ERROR:
+ return -EILSEQ;
+ case NVME_SC_ONCS_NOT_SUPPORTED:
+ return -EOPNOTSUPP;
+ case NVME_SC_WRITE_FAULT:
+ case NVME_SC_READ_ERROR:
+ case NVME_SC_UNWRITTEN_BLOCK:
+ return -ENODATA;
}
}
--
2.11.0
next prev parent reply other threads:[~2017-04-21 6:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-18 13:19 [PATCH] nvme:let dm-mpath distinguish nvme error codes,no retry Guan Junxiong
2017-04-21 6:52 ` Christoph Hellwig [this message]
2017-04-21 10:43 ` Guan Junxiong
2017-04-21 10:59 ` Christoph Hellwig
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=20170421065246.GA3817@infradead.org \
--to=hch@infradead.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