linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH 1/6] nvme: move the dying queue check from cancel to completion
Date: Thu,  2 Nov 2017 21:28:51 +0300	[thread overview]
Message-ID: <20171102182856.9162-2-hch@lst.de> (raw)
In-Reply-To: <20171102182856.9162-1-hch@lst.de>

With multipath we don't want a hard DNR bit on a request that is cancelled
by a controller reset, but instead want to be able to retry it on another
patch.  To archive this don't always set the DNR bit when the queue is
dying in nvme_cancel_request, but defer that decision to
nvme_req_needs_retry.  Note that it applies to any command there and not
just cancelled commands, but one the queue is dying that is the right
thing to do anyway.

Signed-off-by: Christoph Hellwig <hch at lst.de>
---
 drivers/nvme/host/core.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 07b9f4e1c283..1c2686d4eaf3 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -172,6 +172,8 @@ static inline bool nvme_req_needs_retry(struct request *req)
 		return false;
 	if (nvme_req(req)->retries >= nvme_max_retries)
 		return false;
+	if (blk_queue_dying(req->q))
+		return false;
 	return true;
 }
 
@@ -189,18 +191,13 @@ EXPORT_SYMBOL_GPL(nvme_complete_rq);
 
 void nvme_cancel_request(struct request *req, void *data, bool reserved)
 {
-	int status;
-
 	if (!blk_mq_request_started(req))
 		return;
 
 	dev_dbg_ratelimited(((struct nvme_ctrl *) data)->device,
 				"Cancelling I/O %d", req->tag);
 
-	status = NVME_SC_ABORT_REQ;
-	if (blk_queue_dying(req->q))
-		status |= NVME_SC_DNR;
-	nvme_req(req)->status = status;
+	nvme_req(req)->status = NVME_SC_ABORT_REQ;
 	blk_mq_complete_request(req);
 
 }
-- 
2.14.2

  reply	other threads:[~2017-11-02 18:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-02 18:28 nvme cleanups in preparation for the multipath code Christoph Hellwig
2017-11-02 18:28 ` Christoph Hellwig [this message]
2017-11-05 14:01   ` [PATCH 1/6] nvme: move the dying queue check from cancel to completion Sagi Grimberg
2017-11-06 14:46   ` Keith Busch
2017-11-02 18:28 ` [PATCH 2/6] nvme: always unregister the integrity profile in __nvme_revalidate_disk Christoph Hellwig
2017-11-05 14:02   ` Sagi Grimberg
2017-11-06 14:46   ` Keith Busch
2017-11-02 18:28 ` [PATCH 3/6] nvme: don't pass struct nvme_ns to nvme_init_integrity Christoph Hellwig
2017-11-05 14:03   ` Sagi Grimberg
2017-11-06 14:47   ` Keith Busch
2017-11-02 18:28 ` [PATCH 4/6] nvme: don't pass struct nvme_ns to nvme_config_discard Christoph Hellwig
2017-11-06 14:47   ` Keith Busch
2017-11-02 18:28 ` [PATCH 5/6] nvme: set the chunk size before freezing the queue Christoph Hellwig
2017-11-06 14:48   ` Keith Busch
2017-11-02 18:28 ` [PATCH 6/6] nvme: split __nvme_revalidate_disk Christoph Hellwig
2017-11-05 14:05   ` Sagi Grimberg
2017-11-06 14:49   ` Keith Busch

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=20171102182856.9162-2-hch@lst.de \
    --to=hch@lst.de \
    /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;
as well as URLs for NNTP newsgroup(s).