All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme: Return BLK_STS_TARGET if the DNR bit is set
@ 2019-08-06 11:10 Hannes Reinecke
  2019-08-06 13:50 ` Nadolski, Edmund
  0 siblings, 1 reply; 7+ messages in thread
From: Hannes Reinecke @ 2019-08-06 11:10 UTC (permalink / raw)


If the DNR bit is set we should not retry the command, even if
the standard status evaluation indicates so.

Signed-off-by: Hannes Reinecke <hare at suse.com>
---
 drivers/nvme/host/core.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index cc09b81fc7f4..c3e9254f4757 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -279,6 +279,13 @@ void nvme_complete_rq(struct request *req)
 			return;
 		}
 	}
+	/*
+	 * Any pathing error might be retried, but the DNR bit takes
+	 * precedence. So return BLK_STS_TARGET if the DNR bit is set
+	 * to avoid retrying.
+	 */
+	if (blk_path_error(status) && nvme_req(req)->status & NVME_SC_DNR)
+		status = BLK_STS_TARGET;
 	blk_mq_end_request(req, status);
 }
 EXPORT_SYMBOL_GPL(nvme_complete_rq);
-- 
2.16.4

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

end of thread, other threads:[~2019-08-06 14:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-06 11:10 [PATCH] nvme: Return BLK_STS_TARGET if the DNR bit is set Hannes Reinecke
2019-08-06 13:50 ` Nadolski, Edmund
2019-08-06 13:53   ` Hannes Reinecke
2019-08-06 14:07     ` Keith Busch
2019-08-06 14:13       ` Hannes Reinecke
2019-08-06 14:29         ` Keith Busch
2019-08-06 14:35           ` Hannes Reinecke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.