Skip to contentSkip to conversation

Failover criteria unification

PATCH Superseded Keith Busch 4 participants 30 messages Jan 4, 2018 – Jan 9, 2018

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Failover criteria unification

The nvme native multipath provided a separate NVMe status decoder, complicating maintenance as new statuses need to be accounted for. This was already diverging from the generic nvme status decoder, which has implications for other components that rely on accurate generic block errors.

This series unifies common code among nvme and device-mapper multipath so that user experience regarding the failover fate of a command is the same.

Mike:

I split this up because I thought there'd be trouble merging the dm mpath update with the inverted retry logic, but I think you may have rebased the dm-4.16 without that patch, as I'm not seeing it in the most current branch.

Keith Busch (5):
nvme: Add more command status translation nvme/multipath: Consult blk_status_t for failover
block: Provide blk_status_t decoding for retryable errors nvme/multipath: Use blk_retryable
dm mpath: Use blk_retryable

 drivers/md/dm-mpath.c         | 19 ++-----------------
 drivers/nvme/host/core.c      | 15 +++++++++++----
 drivers/nvme/host/multipath.c | 44 ++-----------------------------------------
 drivers/nvme/host/nvme.h      |  4 ++--
 include/linux/blk_types.h     | 16 ++++++++++++++++
 5 files changed, 33 insertions(+), 65 deletions(-)
Signature · 1 line
2.13.6
#1 lore raw

PATCH 1/5 nvme: Add more command status translation

This adds more NVMe status code translations to blk_status_t values, and captures all the current status codes NVMe multipath uses.

---
 drivers/nvme/host/core.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/nvme/host/core.c +6 -0
index 2a69d735efbc..f1cf1f6c5b28 100644
@@ -156,14 +156,20 @@ static blk_status_t nvme_error_status(struct request *req)
 	case NVME_SC_SUCCESS:
 		return BLK_STS_OK;
 	case NVME_SC_CAP_EXCEEDED:
+	case NVME_SC_LBA_RANGE:
 		return BLK_STS_NOSPC;
+	case NVME_SC_BAD_ATTRIBUTES:
 	case NVME_SC_ONCS_NOT_SUPPORTED:
+	case NVME_SC_INVALID_OPCODE:
+	case NVME_SC_INVALID_FIELD:
+	case NVME_SC_INVALID_NS:
 		return BLK_STS_NOTSUPP;
 	case NVME_SC_WRITE_FAULT:
 	case NVME_SC_READ_ERROR:
 	case NVME_SC_UNWRITTEN_BLOCK:
 	case NVME_SC_ACCESS_DENIED:
 	case NVME_SC_READ_ONLY:
+	case NVME_SC_COMPARE_FAILED:
 		return BLK_STS_MEDIUM;
 	case NVME_SC_GUARD_CHECK:
 	case NVME_SC_APPTAG_CHECK:
Signature · 1 line
2.13.6
Reviewed-by on v1 1/5
#3 lore raw

Re: [PATCH 1/5] nvme: Add more command status translation

In reply to Keith Busch
Quoted 24 lines · Keith Busch

This adds more NVMe status code translations to blk_status_t values, and captures all the current status codes NVMe multipath uses.

---
 drivers/nvme/host/core.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/nvme/host/core.c +5 -0
index 2a69d735efbc..f1cf1f6c5b28 100644
@@ -156,14 +156,20 @@ static blk_status_t nvme_error_status(struct request *req)
 	case NVME_SC_SUCCESS:
 		return BLK_STS_OK;
 	case NVME_SC_CAP_EXCEEDED:
+	case NVME_SC_LBA_RANGE:
 		return BLK_STS_NOSPC;
+	case NVME_SC_BAD_ATTRIBUTES:
 	case NVME_SC_ONCS_NOT_SUPPORTED:
+	case NVME_SC_INVALID_OPCODE:
+	case NVME_SC_INVALID_FIELD:
+	case NVME_SC_INVALID_NS:

drivers/nvme/host/core.c static blk_status_t nvme_error_status(struct request *req) · line 175

Quoted 10 lines
drivers/nvme/host/core.c +1 -0
 		return BLK_STS_NOTSUPP;
 	case NVME_SC_WRITE_FAULT:
 	case NVME_SC_READ_ERROR:
 	case NVME_SC_UNWRITTEN_BLOCK:
 	case NVME_SC_ACCESS_DENIED:
 	case NVME_SC_READ_ONLY:
+	case NVME_SC_COMPARE_FAILED:
 		return BLK_STS_MEDIUM;
 	case NVME_SC_GUARD_CHECK:
 	case NVME_SC_APPTAG_CHECK:

Cheers,

Hannes

Signature · 5 lines
Dr. Hannes Reinecke		               zSeries & Storage
[email protected]			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
#4 lore raw

Re: [PATCH 1/5] nvme: Add more command status translation

In reply to Keith Busch
Quoted 13 lines · Keith Busch

This adds more NVMe status code translations to blk_status_t values, and captures all the current status codes NVMe multipath uses.

---
 drivers/nvme/host/core.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/nvme/host/core.c +0 -0
index 2a69d735efbc..f1cf1f6c5b28 100644

drivers/nvme/host/core.c static blk_status_t nvme_error_status(struct request *req) · line 160

Quoted 5 lines
drivers/nvme/host/core.c +1 -0
@@ -156,14 +156,20 @@ static blk_status_t nvme_error_status(struct request *req)
 	case NVME_SC_SUCCESS:
 		return BLK_STS_OK;
 	case NVME_SC_CAP_EXCEEDED:
+	case NVME_SC_LBA_RANGE:
 		return BLK_STS_NOSPC;

lba range isn't really enospc. It is returned when the lba in the command is outside the logical size of the namespace.

#5 lore raw

Re: [PATCH 1/5] nvme: Add more command status translation

Quoted 9 lines · Christoph Hellwig
Quoted 8 lines · Keith Busch

This adds more NVMe status code translations to blk_status_t values, and captures all the current status codes NVMe multipath uses.

---
 drivers/nvme/host/core.c | 6 ++++++
 1 file changed, 6 insertions(+)
Quoted 14 lines

drivers/nvme/host/core.c static blk_status_t nvme_error_status(struct request *req) · line 160

Quoted 10 lines
drivers/nvme/host/core.c +1 -0
index 2a69d735efbc..f1cf1f6c5b28 100644
@@ -156,14 +156,20 @@ static blk_status_t nvme_error_status(struct request *req)
 	case NVME_SC_SUCCESS:
 		return BLK_STS_OK;
 	case NVME_SC_CAP_EXCEEDED:
+	case NVME_SC_LBA_RANGE:
 		return BLK_STS_NOSPC;

lba range isn't really enospc. It is returned when the lba in the command is outside the logical size of the namespace.

Isn't that distinction pretty academic?
The entire block-to-POSIX error mapping is pretty much ad-hoc anyway...

Cheers,

Hannes

Signature · 5 lines
Dr. Hannes Reinecke		               zSeries & Storage
[email protected]			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
#6 lore raw

Re: [PATCH 1/5] nvme: Add more command status translation

Quoted 11 lines · Hannes Reinecke
Quoted 9 lines

drivers/nvme/host/core.c static blk_status_t nvme_error_status(struct request *req) · line 160

Quoted 5 lines
drivers/nvme/host/core.c +1 -0
 	case NVME_SC_SUCCESS:
 		return BLK_STS_OK;
 	case NVME_SC_CAP_EXCEEDED:
+	case NVME_SC_LBA_RANGE:
 		return BLK_STS_NOSPC;

lba range isn't really enospc. It is returned when the lba in the command is outside the logical size of the namespace.

Isn't that distinction pretty academic?
The entire block-to-POSIX error mapping is pretty much ad-hoc anyway...

Yes, BLK_STS_NOSPC matters. And the fix is pretty trivial, so there is no point in arguing.

#7 lore raw

Re: [PATCH 1/5] nvme: Add more command status translation

Quoted 10 lines · Christoph Hellwig
Quoted 9 lines · Hannes Reinecke
Quoted 9 lines

drivers/nvme/host/core.c static blk_status_t nvme_error_status(struct request *req) · line 160

Quoted 5 lines
drivers/nvme/host/core.c +1 -0
 	case NVME_SC_SUCCESS:
 		return BLK_STS_OK;
 	case NVME_SC_CAP_EXCEEDED:
+	case NVME_SC_LBA_RANGE:
 		return BLK_STS_NOSPC;

lba range isn't really enospc. It is returned when the lba in the command is outside the logical size of the namespace.

Quoted 5 lines
Quoted 2 lines

Isn't that distinction pretty academic?
The entire block-to-POSIX error mapping is pretty much ad-hoc anyway...

Yes, BLK_STS_NOSPC matters. And the fix is pretty trivial, so there is no point in arguing.

No argument needed. Definitely needs fixing. Too many upper layers consider BLK_STS_NOSPC retryable (XFS, ext4, dm-thinp, etc). Which NVME_SC_LBA_RANGE absolutely isn't.

When I backfilled NVME_SC_LBA_RANGE handling I categorized it as BLK_STS_TARGET. Do you have a better suggestion for how NVME_SC_LBA_RANGE should be categorized?

Mike

#8 lore raw

Re: [PATCH 1/5] nvme: Add more command status translation

Quoted 7 lines · Mike Snitzer

No argument needed. Definitely needs fixing. Too many upper layers consider BLK_STS_NOSPC retryable (XFS, ext4, dm-thinp, etc). Which NVME_SC_LBA_RANGE absolutely isn't.

When I backfilled NVME_SC_LBA_RANGE handling I categorized it as BLK_STS_TARGET. Do you have a better suggestion for how NVME_SC_LBA_RANGE should be categorized?

It's basically a kernel bug as it tries to access lbas that do not exist. BLK_STS_TARGET should be fine.

#9 lore raw

Re: [PATCH 1/5] nvme: Add more command status translation

Quoted 2 lines · Christoph Hellwig

It's basically a kernel bug as it tries to access lbas that do not exist. BLK_STS_TARGET should be fine.

Okay, I'll fix this and address your other comments, and resend. Thanks for the feedback.

#10 lore raw

PATCH 2/5 nvme/multipath: Consult blk_status_t for failover

In reply to Keith Busch

This removes nvme multipath's specific status decoding to see if failover is needed, using the generic blk_status_t that was translated earlier. This abstraction from the raw NVMe status means nvme status decoding exists in just one place.

---
 drivers/nvme/host/core.c      |  9 +++++----
 drivers/nvme/host/multipath.c | 44 ++++++++-----------------------------------
 drivers/nvme/host/nvme.h      |  4 ++--
 3 files changed, 15 insertions(+), 42 deletions(-)
drivers/nvme/host/core.c +5 -4
index f1cf1f6c5b28..4afc681f7089 100644
@@ -196,8 +196,10 @@ static inline bool nvme_req_needs_retry(struct request *req)
 
 void nvme_complete_rq(struct request *req)
 {
-	if (unlikely(nvme_req(req)->status && nvme_req_needs_retry(req))) {
-		if (nvme_req_needs_failover(req)) {
+	blk_status_t status = nvme_error_status(req);
+
+	if (unlikely(status != BLK_STS_OK && nvme_req_needs_retry(req))) {
+		if (nvme_req_needs_failover(req, status)) {
 			nvme_failover_req(req);
 			return;
 		}
@@ -208,8 +210,7 @@ void nvme_complete_rq(struct request *req)
 			return;
 		}
 	}
-
-	blk_mq_end_request(req, nvme_error_status(req));
+	blk_mq_end_request(req, status);
 }
 EXPORT_SYMBOL_GPL(nvme_complete_rq);
 
drivers/nvme/host/multipath.c +8 -36

54 lines not on this page · raw message

drivers/nvme/host/nvme.h +2 -2
index ea1aa5283e8e..cf8548c1d7ec 100644
@@ -401,7 +401,7 @@ extern const struct block_device_operations nvme_ns_head_ops;
 
 #ifdef CONFIG_NVME_MULTIPATH
 void nvme_failover_req(struct request *req);
-bool nvme_req_needs_failover(struct request *req);
+bool nvme_req_needs_failover(struct request *req, blk_status_t error);
 void nvme_kick_requeue_lists(struct nvme_ctrl *ctrl);
 int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl,struct nvme_ns_head *head);
 void nvme_mpath_add_disk(struct nvme_ns_head *head);
@@ -421,7 +421,7 @@ struct nvme_ns *nvme_find_path(struct nvme_ns_head *head);
 static inline void nvme_failover_req(struct request *req)
 {
 }
-static inline bool nvme_req_needs_failover(struct request *req)
+static inline bool nvme_req_needs_failover(struct request *req, blk_status_t error)
 {
 	return false;
 }
Signature · 1 line
2.13.6
Acked-by on v1 2/5
#11 lore raw

Re: [PATCH 2/5] nvme/multipath: Consult blk_status_t for failover

Quoted 6 lines · Keith Busch

This removes nvme multipath's specific status decoding to see if failover is needed, using the generic blk_status_t that was translated earlier. This abstraction from the raw NVMe status means nvme status decoding exists in just one place.

#12 lore raw

Re: [PATCH 2/5] nvme/multipath: Consult blk_status_t for failover

In reply to Keith Busch
Quoted 5 lines · Keith Busch

This removes nvme multipath's specific status decoding to see if failover is needed, using the generic blk_status_t that was translated earlier. This abstraction from the raw NVMe status means nvme status decoding exists in just one place.

Quoted 7 lines
---
 drivers/nvme/host/core.c      |  9 +++++----
 drivers/nvme/host/multipath.c | 44 ++++++++-----------------------------------
 drivers/nvme/host/nvme.h      |  4 ++--
 3 files changed, 15 insertions(+), 42 deletions(-)

Cheers,

Hannes

Signature · 5 lines
Dr. Hannes Reinecke		               zSeries & Storage
[email protected]			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
#13 lore raw

Re: [PATCH 2/5] nvme/multipath: Consult blk_status_t for failover

In reply to Keith Busch

drivers/nvme/host/core.c static inline bool nvme_req_needs_retry(struct request *req) · line 202

Quoted 6 lines
drivers/nvme/host/core.c +4 -2
-	if (unlikely(nvme_req(req)->status && nvme_req_needs_retry(req))) {
-		if (nvme_req_needs_failover(req)) {
+	blk_status_t status = nvme_error_status(req);
+
+	if (unlikely(status != BLK_STS_OK && nvme_req_needs_retry(req))) {
+		if (nvme_req_needs_failover(req, status)) {

We don't really need to call nvme_error_status if nvme_req(req)->status is zero.

drivers/nvme/host/nvme.h struct nvme_ns *nvme_find_path(struct nvme_ns_head *head); · line 424

Quoted 2 lines
drivers/nvme/host/nvme.h +1 -1
-static inline bool nvme_req_needs_failover(struct request *req)
+static inline bool nvme_req_needs_failover(struct request *req, blk_status_t error)

line break after 80 characters, please.

#14 lore raw

Re: [PATCH 2/5] nvme/multipath: Consult blk_status_t for failover

Quoted 9 lines · Christoph Hellwig

drivers/nvme/host/core.c static inline bool nvme_req_needs_retry(struct request *req) · line 202

Quoted 6 lines
drivers/nvme/host/core.c +4 -2
-	if (unlikely(nvme_req(req)->status && nvme_req_needs_retry(req))) {
-		if (nvme_req_needs_failover(req)) {
+	blk_status_t status = nvme_error_status(req);
+
+	if (unlikely(status != BLK_STS_OK && nvme_req_needs_retry(req))) {
+		if (nvme_req_needs_failover(req, status)) {

We don't really need to call nvme_error_status if nvme_req(req)->status is zero.

We are already calling nvme_error_status unconditionally for blk_mq_end_request, so we currently read nvme_req(req)->status multiple times in the completion path. I think we'd prefer to read it just once.

#15 lore raw

Re: [PATCH 2/5] nvme/multipath: Consult blk_status_t for failover

Quoted 11 lines · Keith Busch
Quoted 9 lines · Christoph Hellwig

drivers/nvme/host/core.c static inline bool nvme_req_needs_retry(struct request *req) · line 202

Quoted 6 lines
drivers/nvme/host/core.c +4 -2
-	if (unlikely(nvme_req(req)->status && nvme_req_needs_retry(req))) {
-		if (nvme_req_needs_failover(req)) {
+	blk_status_t status = nvme_error_status(req);
+
+	if (unlikely(status != BLK_STS_OK && nvme_req_needs_retry(req))) {
+		if (nvme_req_needs_failover(req, status)) {

We don't really need to call nvme_error_status if nvme_req(req)->status is zero.

Quoted 3 lines

We are already calling nvme_error_status unconditionally for blk_mq_end_request, so we currently read nvme_req(req)->status multiple times in the completion path. I think we'd prefer to read it just once.

Indeed. Objection retracted.

#16 lore raw

PATCH 3/5 block: Provide blk_status_t decoding for retryable errors

In reply to Keith Busch

This patch provides a common decoder for block status that may be retried so various entities wishing to consult this do not have to duplicate this decision.

---
 include/linux/blk_types.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
include/linux/blk_types.h +16 -0
index a1e628e032da..b6a8723b493c 100644
@@ -39,6 +39,22 @@ typedef u8 __bitwise blk_status_t;
 
 #define BLK_STS_AGAIN		((__force blk_status_t)12)
 
+static inline bool blk_retryable(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:
+	case BLK_STS_PROTECTION:
+		return false;
+	}
+
+	/* Anything else could be a path failure, so should be retried */
+	return true;
+}
+
 struct blk_issue_stat {
 	u64 stat;
 };
Signature · 1 line
2.13.6
Reviewed-by on v1 3/5
#18 lore raw

Re: [PATCH 3/5] block: Provide blk_status_t decoding for retryable errors

In reply to Keith Busch
Quoted 27 lines · Keith Busch

This patch provides a common decoder for block status that may be retried so various entities wishing to consult this do not have to duplicate this decision.

---
 include/linux/blk_types.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
include/linux/blk_types.h +9 -0
index a1e628e032da..b6a8723b493c 100644
@@ -39,6 +39,22 @@ typedef u8 __bitwise blk_status_t;
 
 #define BLK_STS_AGAIN		((__force blk_status_t)12)
 
+static inline bool blk_retryable(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:
+	case BLK_STS_PROTECTION:

include/linux/blk_types.h typedef u8 __bitwise blk_status_t; · line 60

Quoted 10 lines
include/linux/blk_types.h +7 -0
+		return false;
+	}
+
+	/* Anything else could be a path failure, so should be retried */
+	return true;
+}
+
 struct blk_issue_stat {
 	u64 stat;
 };

Cheers,

Hannes

Signature · 5 lines
Dr. Hannes Reinecke		               zSeries & Storage
[email protected]			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
#19 lore raw

Re: [PATCH 3/5] block: Provide blk_status_t decoding for retryable errors

In reply to Keith Busch
Quoted 1 line

+static inline bool blk_retryable(blk_status_t error)

The naming isn't really useful - it is about the fact that it's worth retrying on another path. So please chose a better name, and add a kerneldoc comment describing it.

#20 lore raw

PATCH 4/5 nvme/multipath: Use blk_retryable

In reply to Keith Busch

Uses common code for determining if an error should be retried on alternate path.

---
 drivers/nvme/host/multipath.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/nvme/host/multipath.c +1 -13
index ae9abb600c0f..93bb72b6efb6 100644
@@ -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_retryable(error);
 }
 
 void nvme_kick_requeue_lists(struct nvme_ctrl *ctrl)
Signature · 1 line
2.13.6
Reviewed-by on v1 4/5
#22 lore raw

Re: [PATCH 4/5] nvme/multipath: Use blk_retryable

In reply to Keith Busch
Quoted 24 lines · Keith Busch

Uses common code for determining if an error should be retried on alternate path.

---
 drivers/nvme/host/multipath.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/nvme/host/multipath.c +0 -7
index ae9abb600c0f..93bb72b6efb6 100644
@@ -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:

drivers/nvme/host/multipath.c bool nvme_req_needs_failover(struct request *req, blk_status_t error) · line 43

Quoted 10 lines
drivers/nvme/host/multipath.c +1 -6
-	case BLK_STS_PROTECTION:
-		return false;
-	}
-
-	/* Everything else could be a path failure, so should be retried */
-	return true;
+	return blk_retryable(error);
 }
 
 void nvme_kick_requeue_lists(struct nvme_ctrl *ctrl)

Cheers,

Hannes

Signature · 5 lines
Dr. Hannes Reinecke		               zSeries & Storage
[email protected]			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
#23 lore raw

PATCH 5/5 dm mpath: Use blk_retryable

In reply to Keith Busch

Uses common code for determining if an error should be retried on alternate path.

---
 drivers/md/dm-mpath.c | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)
drivers/md/dm-mpath.c +2 -17
index f7810cc869ac..3eb9500db1b3 100644
@@ -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)
Signature · 1 line
2.13.6
Reviewed-by on v1 5/5
#25 lore raw

Re: [PATCH 5/5] dm mpath: Use blk_retryable

In reply to Keith Busch
Quoted 8 lines · Keith Busch

Uses common code for determining if an error should be retried on alternate path.

---
 drivers/md/dm-mpath.c | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

Cheers,

Hannes

Signature · 5 lines
Dr. Hannes Reinecke		               zSeries & Storage
[email protected]			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
#26 lore raw
In reply to Keith Busch
Quoted 10 lines · Keith Busch

The nvme native multipath provided a separate NVMe status decoder, complicating maintenance as new statuses need to be accounted for. This was already diverging from the generic nvme status decoder, which has implications for other components that rely on accurate generic block errors.

This series unifies common code among nvme and device-mapper multipath so that user experience regarding the failover fate of a command is the same.

Quoted 6 lines

Mike:

I split this up because I thought there'd be trouble merging the dm mpath update with the inverted retry logic, but I think you may have rebased the dm-4.16 without that patch, as I'm not seeing it in the most current branch.

Right, I dropped that patch since it'd have only resulted in conflicts come merge time. As such, this series can easily go through the nvme tree to Jens.

#27 lore raw
Quoted 3 lines · Mike Snitzer

Right, I dropped that patch since it'd have only resulted in conflicts come merge time. As such, this series can easily go through the nvme tree to Jens.

It looks like you can also touch up dm to allow it to multipath nvme even if CONFIG_NVME_MULTIPATH is set. It may be useful since native NVMe doesn't multipath namespaces across subsystems, and some crack smoking people want to create something that requires that.

#28 lore raw
Quoted 9 lines · Keith Busch
Quoted 3 lines · Mike Snitzer

Right, I dropped that patch since it'd have only resulted in conflicts come merge time. As such, this series can easily go through the nvme tree to Jens.

It looks like you can also touch up dm to allow it to multipath nvme even if CONFIG_NVME_MULTIPATH is set. It may be useful since native NVMe doesn't multipath namespaces across subsystems, and some crack smoking people want to create something that requires that.

I had a "CONFIG_NVME_MULITIPATH=Y" typo in the dm-mpath.c commit that added the CONFIG_NVME_MULTIPATH mutual exclussion in dm-4.16; so I just dropped it via rebase.

So now the underlying nvme devices (already multipath'd by NVMe) should be discoverable by multipathd. Who am I to judge crack smokers?

#29 lore raw
In reply to Keith Busch
Quoted 4 lines · Keith Busch

It looks like you can also touch up dm to allow it to multipath nvme even if CONFIG_NVME_MULTIPATH is set. It may be useful since native NVMe doesn't multipath namespaces across subsystems, and some crack smoking people want to create something that requires that.

Right now that is simply not allowed by the spec. If Dave comes up with a palatable way to retrofit that into the spec we'll support it.