From: kbusch@kernel.org (Keith Busch)
Subject: [PATCH] nvme: Return BLK_STS_TARGET if the DNR bit is set
Date: Tue, 6 Aug 2019 08:29:17 -0600 [thread overview]
Message-ID: <20190806142917.GB24030@localhost.localdomain> (raw)
In-Reply-To: <31e6f42e-2157-077c-64d4-a5a31caf0aa4@suse.de>
On Tue, Aug 06, 2019@04:13:40PM +0200, Hannes Reinecke wrote:
> On 8/6/19 4:07 PM, Keith Busch wrote:
> > On Tue, Aug 06, 2019@03:53:29PM +0200, Hannes Reinecke wrote:
> > > On 8/6/19 3:50 PM, Nadolski, Edmund wrote:
> > > > On 8/6/2019 5:10 AM, Hannes Reinecke wrote:
> > > > > 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);
> > > > >
> > > >
> > > > - If DNR always takes precedence, is the blk_path_error() check still
> > > > needed?
> > > >
> > > It takes precedence in the sense that it should cause the command not to be
> > > retried. It should not overwrite any error code indicating a non-retryable
> > > error.
> >
> > But we're already past the nvme retry logic, which also handles the DNR
> > bit. Who is this telling not to retry?
> >
> Anything layered on top of it, namely dm-multipath or MD.
Okay, that's what I thought. Can we just move this check to fit in the
unlikely() error case just above where you have it?
next prev parent reply other threads:[~2019-08-06 14:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2019-08-06 14:35 ` Hannes Reinecke
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=20190806142917.GB24030@localhost.localdomain \
--to=kbusch@kernel.org \
/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).