From: hare@suse.de (Hannes Reinecke)
Subject: [PATCHv3] nvme: Return BLK_STS_TARGET if the DNR bit is set
Date: Tue, 13 Aug 2019 18:56:58 +0200 [thread overview]
Message-ID: <ceea7aaf-9537-ea19-8abe-bda525582170@suse.de> (raw)
In-Reply-To: <5c6ec6e6-d2ae-2e3b-0adc-e30cbcce528b@grimberg.me>
On 8/13/19 6:37 PM, Sagi Grimberg wrote:
>
>> We need to override the default nvme_error_status() to BLK_STS_TARGET
>> when DNR is set to prevent upper layers from their own retries/failover.
>> I suggested adding that check in the existing unlikely() case, but maybe
>> it's more obvious if we teach nvme_error_status() to default to return
>> BLK_STS_TARGET for this condition?
>>
>> ---
>> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
>> index 8f3fbe5ca937..50adcdde44d5 100644
>> --- a/drivers/nvme/host/core.c
>> +++ b/drivers/nvme/host/core.c
>> @@ -199,6 +199,9 @@ static inline bool nvme_ns_has_pi(struct nvme_ns *ns)
>> ? static blk_status_t nvme_error_status(struct request *req)
>> ? {
>> +??? if (unlikely(nvme_req(req)->status & NVME_SC_DNR))
>> +??????? return BLK_STS_TARGET;
>> +
>> ????? switch (nvme_req(req)->status & 0x7ff) {
>> ????? case NVME_SC_SUCCESS:
>> ????????? return BLK_STS_OK;
>> --
>
> Makes sense to me, Hannes does this address your issue?
Oh, yes, it does.
I was slightly worried as we would override other non-retryable status
codes, but as there is no definite mapping which status codes are
retryable we can go with this one.
I'll be sending a patch.
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare at suse.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG N?rnberg)
next prev parent reply other threads:[~2019-08-13 16:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-12 7:51 [PATCHv3] nvme: Return BLK_STS_TARGET if the DNR bit is set Hannes Reinecke
2019-08-12 23:37 ` Nadolski, Edmund
2019-08-13 6:32 ` Sagi Grimberg
2019-08-13 14:15 ` Keith Busch
2019-08-13 16:37 ` Sagi Grimberg
2019-08-13 16:56 ` Hannes Reinecke [this message]
2019-08-13 17:01 ` Christoph Hellwig
2019-08-13 17:03 ` Hannes Reinecke
2019-08-13 17:08 ` Christoph Hellwig
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=ceea7aaf-9537-ea19-8abe-bda525582170@suse.de \
--to=hare@suse.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).