linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvme: always treat DNR status as no-retryable
@ 2019-11-26 13:37 Hannes Reinecke
  2019-11-26 16:15 ` Keith Busch
  2019-11-26 16:22 ` Christoph Hellwig
  0 siblings, 2 replies; 6+ messages in thread
From: Hannes Reinecke @ 2019-11-26 13:37 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Keith Busch, Sagi Grimberg, linux-nvme, Hannes Reinecke

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 <hare@suse.de>
---
 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-11-26 16:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-26 13:37 [PATCH] nvme: always treat DNR status as no-retryable Hannes Reinecke
2019-11-26 16:15 ` Keith Busch
2019-11-26 16:34   ` Hannes Reinecke
2019-11-26 16:39     ` Christoph Hellwig
2019-11-26 16:22 ` Christoph Hellwig
2019-11-26 16:28   ` Hannes Reinecke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).