From: keith.busch@intel.com (Keith Busch)
Subject: [PATCH 5/5] dm mpath: Use blk_retryable
Date: Thu, 4 Jan 2018 15:46:23 -0700 [thread overview]
Message-ID: <20180104224623.8944-6-keith.busch@intel.com> (raw)
In-Reply-To: <20180104224623.8944-1-keith.busch@intel.com>
Uses common code for determining if an error should be retried on
alternate path.
Signed-off-by: Keith Busch <keith.busch at intel.com>
---
drivers/md/dm-mpath.c | 19 ++-----------------
1 file changed, 2 insertions(+), 17 deletions(-)
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index f7810cc869ac..3eb9500db1b3 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -1475,21 +1475,6 @@ static void activate_path_work(struct work_struct *work)
activate_or_offline_path(pgpath);
}
-static int noretry_error(blk_status_t error)
-{
- switch (error) {
- case BLK_STS_NOTSUPP:
- case BLK_STS_NOSPC:
- case BLK_STS_TARGET:
- case BLK_STS_NEXUS:
- case BLK_STS_MEDIUM:
- return 1;
- }
-
- /* Anything else could be a path failure, so should be retried */
- return 0;
-}
-
static int multipath_end_io(struct dm_target *ti, struct request *clone,
blk_status_t error, union map_info *map_context)
{
@@ -1508,7 +1493,7 @@ static int multipath_end_io(struct dm_target *ti, struct request *clone,
* request into dm core, which will remake a clone request and
* clone bios for it and resubmit it later.
*/
- if (error && !noretry_error(error)) {
+ if (error && blk_retryable(error)) {
struct multipath *m = ti->private;
r = DM_ENDIO_REQUEUE;
@@ -1544,7 +1529,7 @@ static int multipath_end_io_bio(struct dm_target *ti, struct bio *clone,
unsigned long flags;
int r = DM_ENDIO_DONE;
- if (!*error || noretry_error(*error))
+ if (!*error || !blk_retryable(*error))
goto done;
if (pgpath)
--
2.13.6
next prev parent reply other threads:[~2018-01-04 22:46 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-04 22:46 [PATCH 0/5] Failover criteria unification Keith Busch
2018-01-04 22:46 ` [PATCH 1/5] nvme: Add more command status translation Keith Busch
2018-01-04 23:41 ` Mike Snitzer
2018-01-08 8:39 ` Hannes Reinecke
2018-01-08 9:55 ` Christoph Hellwig
2018-01-08 10:09 ` Hannes Reinecke
2018-01-08 10:19 ` Christoph Hellwig
2018-01-08 15:29 ` Mike Snitzer
2018-01-08 15:34 ` Christoph Hellwig
2018-01-08 16:12 ` Keith Busch
2018-01-04 22:46 ` [PATCH 2/5] nvme/multipath: Consult blk_status_t for failover Keith Busch
2018-01-04 23:42 ` Mike Snitzer
2018-01-08 8:57 ` Hannes Reinecke
2018-01-08 9:57 ` Christoph Hellwig
2018-01-09 17:38 ` Keith Busch
2018-01-09 17:40 ` Christoph Hellwig
2018-01-04 22:46 ` [PATCH 3/5] block: Provide blk_status_t decoding for retryable errors Keith Busch
2018-01-04 23:43 ` Mike Snitzer
2018-01-08 8:58 ` Hannes Reinecke
2018-01-08 9:58 ` Christoph Hellwig
2018-01-04 22:46 ` [PATCH 4/5] nvme/multipath: Use blk_retryable Keith Busch
2018-01-04 23:44 ` Mike Snitzer
2018-01-08 8:58 ` Hannes Reinecke
2018-01-04 22:46 ` Keith Busch [this message]
2018-01-04 23:45 ` [PATCH 5/5] dm mpath: " Mike Snitzer
2018-01-08 8:59 ` Hannes Reinecke
2018-01-04 23:36 ` [PATCH 0/5] Failover criteria unification Mike Snitzer
2018-01-04 23:47 ` Keith Busch
2018-01-05 0:07 ` Mike Snitzer
2018-01-08 9:58 ` 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=20180104224623.8944-6-keith.busch@intel.com \
--to=keith.busch@intel.com \
/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