提交 0728af6f 编写于 作者: S Sagi Grimberg 提交者: Yang Yingliang

nvme: pass status to nvme_error_status

mainline inclusion
from mainline-v5.4-rc1
commit 2f9c1736
category: bugfix
bugzilla: NA
CVE: NA
Link: https://gitee.com/openeuler/kernel/issues/I1WGZE

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

No need for the full blown request structure.
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NSagi Grimberg <sagi@grimberg.me>
Reviewed-by: NChao Leng <lengchao@huawei.com>
Reviewed-by: NJike Cheng <chengjike.cheng@huawei.com>
Signed-off-by: NLijie <lijie34@huawei.com>
Reviewed-by: NTao Hou <houtao1@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 04a88639
...@@ -209,9 +209,9 @@ static inline bool nvme_ns_has_pi(struct nvme_ns *ns) ...@@ -209,9 +209,9 @@ static inline bool nvme_ns_has_pi(struct nvme_ns *ns)
return ns->pi_type && ns->ms == sizeof(struct t10_pi_tuple); return ns->pi_type && ns->ms == sizeof(struct t10_pi_tuple);
} }
static blk_status_t nvme_error_status(struct request *req) static blk_status_t nvme_error_status(u16 status)
{ {
switch (nvme_req(req)->status & 0x7ff) { switch (status & 0x7ff) {
case NVME_SC_SUCCESS: case NVME_SC_SUCCESS:
return BLK_STS_OK; return BLK_STS_OK;
case NVME_SC_CAP_EXCEEDED: case NVME_SC_CAP_EXCEEDED:
...@@ -272,7 +272,7 @@ static void nvme_retry_req(struct request *req) ...@@ -272,7 +272,7 @@ static void nvme_retry_req(struct request *req)
void nvme_complete_rq(struct request *req) void nvme_complete_rq(struct request *req)
{ {
blk_status_t status = nvme_error_status(req); blk_status_t status = nvme_error_status(nvme_req(req)->status);
trace_nvme_complete_rq(req); trace_nvme_complete_rq(req);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册