提交 72438fc4 编写于 作者: S Sagi Grimberg 提交者: Yang Yingliang

nvme: fix identify error status silent ignore

mainline inclusion
from mainline-v5.8-rc4
commit ea43d970
category: bugfix
bugzilla: NA
CVE: NA
Link: https://gitee.com/openeuler/kernel/issues/I4JFBE?from=project-issue

-------------------------------------------------

Commit 59c7c3ca 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: 59c7c3ca ("nvme: fix possible hang when ns scanning fails during error recovery")
Reported-by: NKeith Busch <kbusch@kernel.org>
Signed-off-by: NSagi Grimberg <sagi@grimberg.me>
Reviewed-by: NKeith Busch <kbusch@kernel.org>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: Nchengjike <chengjike.cheng@huawei.com>
Reviewed-by: NHou Tao <houtao1@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 7d7e3cbd
...@@ -1001,10 +1001,16 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid, ...@@ -1001,10 +1001,16 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid,
dev_warn(ctrl->device, dev_warn(ctrl->device,
"Identify Descriptors failed (%d)\n", status); "Identify Descriptors failed (%d)\n", status);
/* /*
* Don't treat an error as fatal, as we potentially already * Don't treat non-retryable errors as fatal, as we potentially
* have a NGUID or EUI-64. * already have a NGUID or EUI-64. If we failed with DNR set,
* we want to silently ignore the error as we can still
* identify the device, but if the status has DNR set, we want
* to propagate the error back specifically for the disk
* revalidation flow to make sure we don't abandon the
* device just because of a temporal retry-able error (such
* as path of transport errors).
*/ */
if (status > 0 && !(status & NVME_SC_DNR)) if (status > 0 && (status & NVME_SC_DNR))
status = 0; status = 0;
goto free_data; goto free_data;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册