Skip to content

Commit ea43d97

Browse files
sagigrimbergChristoph Hellwig
authored andcommitted
nvme: fix identify error status silent ignore
Commit 59c7c3c 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: 59c7c3c ("nvme: fix possible hang when ns scanning fails during error recovery") Reported-by: Keith Busch <[email protected]> Signed-off-by: Sagi Grimberg <[email protected]> Reviewed-by: Keith Busch <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent e7eea44 commit ea43d97

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

drivers/nvme/host/core.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,10 +1116,16 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid,
11161116
dev_warn(ctrl->device,
11171117
"Identify Descriptors failed (%d)\n", status);
11181118
/*
1119-
* Don't treat an error as fatal, as we potentially already
1120-
* have a NGUID or EUI-64.
1119+
* Don't treat non-retryable errors as fatal, as we potentially
1120+
* already have a NGUID or EUI-64. If we failed with DNR set,
1121+
* we want to silently ignore the error as we can still
1122+
* identify the device, but if the status has DNR set, we want
1123+
* to propagate the error back specifically for the disk
1124+
* revalidation flow to make sure we don't abandon the
1125+
* device just because of a temporal retry-able error (such
1126+
* as path of transport errors).
11211127
*/
1122-
if (status > 0 && !(status & NVME_SC_DNR))
1128+
if (status > 0 && (status & NVME_SC_DNR))
11231129
status = 0;
11241130
goto free_data;
11251131
}

0 commit comments

Comments
 (0)