Home Home > GIT Browse > SLE12-SP5-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2019-08-21 14:41:42 +0200
committerHannes Reinecke <hare@suse.de>2019-08-21 14:41:42 +0200
commit52a6c2f892d0b0635aff75c36876a7a6c76f313d (patch)
treebddc202db3185beef3c390bf310d1abe5430141e
parent671c1a44d8c59e2da7105bb4c7bc26a48b2939da (diff)
nvme: Return BLK_STS_TARGET if the DNR bit is set (bsc#1142076).
-rw-r--r--drivers/nvme/host/core.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 673b060a056c..8a8d4a966e7e 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -265,6 +265,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);