* [PATCH] nvme: fix identify error status silent ignore
@ 2020-06-24 23:56 Sagi Grimberg
0 siblings, 0 replies; 7+ messages in thread
From: Sagi Grimberg @ 2020-06-24 23:56 UTC (permalink / raw)
To: linux-nvme, Christoph Hellwig, Keith Busch
Patch 59c7c3caaaf8 intended to only silently ignore
non retry-able errors (DNR bit set) such that we can still
identify misbehaving controllers, and in the other hand
propagate retry-able errors (DNR bit cleared) so we don't
wrongly abandon a namespace just because it happens to be
temporarily inaccessible.
The goal remains the same as the original commit where this
was introduced but unfortunately had the logic backwards.
Fixes: 59c7c3caaaf8 ("nvme: fix possible hang when ns
scanning fails during error recovery")
Reported-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
---
drivers/nvme/host/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 2afed32d3892..3e84ab6c2bd3 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1130,7 +1130,7 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid,
* Don't treat an error as fatal, as we potentially already
* have a NGUID or EUI-64.
*/
- if (status > 0 && !(status & NVME_SC_DNR))
+ if (status > 0 && (status & NVME_SC_DNR))
status = 0;
goto free_data;
}
--
2.25.1
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] nvme: fix identify error status silent ignore
2020-06-26 8:24 ` Christoph Hellwig
@ 2020-06-28 5:28 ` Sagi Grimberg
0 siblings, 0 replies; 7+ messages in thread
From: Sagi Grimberg @ 2020-06-28 5:28 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Keith Busch, linux-nvme
>> Patch 59c7c3caaaf8 intended to only silently ignore
>> non retry-able errors (DNR bit set) such that we can still
>> identify misbehaving controllers, and in the other hand
>> propagate retry-able errors (DNR bit cleared) so we don't
>> wrongly abandon a namespace just because it happens to be
>> temporarily inaccessible.
>>
>> The goal remains the same as the original commit where this
>> was introduced but unfortunately had the logic backwards.
>
> This probably also needs to be added to the comment to explain WTF is
> going on here..
Sent v3
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] nvme: fix identify error status silent ignore
2020-06-25 0:02 Sagi Grimberg
2020-06-25 13:50 ` Niklas Cassel
2020-06-25 17:06 ` Keith Busch
@ 2020-06-26 8:24 ` Christoph Hellwig
2020-06-28 5:28 ` Sagi Grimberg
2 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2020-06-26 8:24 UTC (permalink / raw)
To: Sagi Grimberg; +Cc: Keith Busch, Christoph Hellwig, linux-nvme
On Wed, Jun 24, 2020 at 05:02:57PM -0700, Sagi Grimberg wrote:
> Patch 59c7c3caaaf8 intended to only silently ignore
> non retry-able errors (DNR bit set) such that we can still
> identify misbehaving controllers, and in the other hand
> propagate retry-able errors (DNR bit cleared) so we don't
> wrongly abandon a namespace just because it happens to be
> temporarily inaccessible.
>
> The goal remains the same as the original commit where this
> was introduced but unfortunately had the logic backwards.
This probably also needs to be added to the comment to explain WTF is
going on here..
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] nvme: fix identify error status silent ignore
2020-06-25 17:06 ` Keith Busch
@ 2020-06-25 18:13 ` Sagi Grimberg
0 siblings, 0 replies; 7+ messages in thread
From: Sagi Grimberg @ 2020-06-25 18:13 UTC (permalink / raw)
To: Keith Busch; +Cc: Christoph Hellwig, linux-nvme
>> @@ -1130,7 +1130,7 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid,
>> - if (status > 0 && !(status & NVME_SC_DNR))
>> + if (status > 0 && (status & NVME_SC_DNR))
>> status = 0;
>
> Just remove the gratuitous parens, and okay to go. I'll rebase the zns
> tree with this patch.
I think it reads better as is, but I don't care too much.
Do note that this should go to 5.8-rc and the zns will
go to 5.9, but we should be able to handle that as its
early enough...
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] nvme: fix identify error status silent ignore
2020-06-25 0:02 Sagi Grimberg
2020-06-25 13:50 ` Niklas Cassel
@ 2020-06-25 17:06 ` Keith Busch
2020-06-25 18:13 ` Sagi Grimberg
2020-06-26 8:24 ` Christoph Hellwig
2 siblings, 1 reply; 7+ messages in thread
From: Keith Busch @ 2020-06-25 17:06 UTC (permalink / raw)
To: Sagi Grimberg; +Cc: Christoph Hellwig, linux-nvme
On Wed, Jun 24, 2020 at 05:02:57PM -0700, Sagi Grimberg wrote:
> @@ -1130,7 +1130,7 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid,
> - if (status > 0 && !(status & NVME_SC_DNR))
> + if (status > 0 && (status & NVME_SC_DNR))
> status = 0;
Just remove the gratuitous parens, and okay to go. I'll rebase the zns
tree with this patch.
Reviewed-by: Keith Busch <kbusch@kernel.org>
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] nvme: fix identify error status silent ignore
2020-06-25 0:02 Sagi Grimberg
@ 2020-06-25 13:50 ` Niklas Cassel
2020-06-25 17:06 ` Keith Busch
2020-06-26 8:24 ` Christoph Hellwig
2 siblings, 0 replies; 7+ messages in thread
From: Niklas Cassel @ 2020-06-25 13:50 UTC (permalink / raw)
To: Sagi Grimberg; +Cc: Keith Busch, Christoph Hellwig, linux-nvme
On Wed, Jun 24, 2020 at 05:02:57PM -0700, Sagi Grimberg wrote:
> Patch 59c7c3caaaf8 intended to only silently ignore
> non retry-able errors (DNR bit set) such that we can still
> identify misbehaving controllers, and in the other hand
> propagate retry-able errors (DNR bit cleared) so we don't
> wrongly abandon a namespace just because it happens to be
> temporarily inaccessible.
>
> The goal remains the same as the original commit where this
> was introduced but unfortunately had the logic backwards.
>
> Fixes: 59c7c3caaaf8 ("nvme: fix possible hang when ns
> scanning fails during error recovery")
> Reported-by: Keith Busch <kbusch@kernel.org>
> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
> ---
> drivers/nvme/host/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 2afed32d3892..3e84ab6c2bd3 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -1130,7 +1130,7 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid,
> * Don't treat an error as fatal, as we potentially already
> * have a NGUID or EUI-64.
> */
> - if (status > 0 && !(status & NVME_SC_DNR))
> + if (status > 0 && (status & NVME_SC_DNR))
The extra parentheses can also be dropped now when the there is no longer
any need for negation.
Kind regards,
Niklas
> status = 0;
> goto free_data;
> }
> --
> 2.25.1
>
>
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] nvme: fix identify error status silent ignore
@ 2020-06-25 0:02 Sagi Grimberg
2020-06-25 13:50 ` Niklas Cassel
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Sagi Grimberg @ 2020-06-25 0:02 UTC (permalink / raw)
To: linux-nvme, Christoph Hellwig, Keith Busch
Patch 59c7c3caaaf8 intended to only silently ignore
non retry-able errors (DNR bit set) such that we can still
identify misbehaving controllers, and in the other hand
propagate retry-able errors (DNR bit cleared) so we don't
wrongly abandon a namespace just because it happens to be
temporarily inaccessible.
The goal remains the same as the original commit where this
was introduced but unfortunately had the logic backwards.
Fixes: 59c7c3caaaf8 ("nvme: fix possible hang when ns
scanning fails during error recovery")
Reported-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
---
drivers/nvme/host/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 2afed32d3892..3e84ab6c2bd3 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1130,7 +1130,7 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid,
* Don't treat an error as fatal, as we potentially already
* have a NGUID or EUI-64.
*/
- if (status > 0 && !(status & NVME_SC_DNR))
+ if (status > 0 && (status & NVME_SC_DNR))
status = 0;
goto free_data;
}
--
2.25.1
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-06-28 5:29 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-24 23:56 [PATCH] nvme: fix identify error status silent ignore Sagi Grimberg
2020-06-25 0:02 Sagi Grimberg
2020-06-25 13:50 ` Niklas Cassel
2020-06-25 17:06 ` Keith Busch
2020-06-25 18:13 ` Sagi Grimberg
2020-06-26 8:24 ` Christoph Hellwig
2020-06-28 5:28 ` Sagi Grimberg
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).