diff options
Diffstat (limited to 'drivers/nvme/target/discovery.c')
-rw-r--r-- | drivers/nvme/target/discovery.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/nvme/target/discovery.c b/drivers/nvme/target/discovery.c index e1bb254671de..d2cb71a0b419 100644 --- a/drivers/nvme/target/discovery.c +++ b/drivers/nvme/target/discovery.c @@ -259,6 +259,8 @@ static void nvmet_execute_disc_set_features(struct nvmet_req *req) NVMET_DISC_AEN_CFG_OPTIONAL); break; default: + req->error_loc = + offsetof(struct nvme_common_command, cdw10); stat = NVME_SC_INVALID_FIELD | NVME_SC_DNR; break; } @@ -279,6 +281,8 @@ static void nvmet_execute_disc_get_features(struct nvmet_req *req) nvmet_get_feat_async_event(req); break; default: + req->error_loc = + offsetof(struct nvme_common_command, cdw10); stat = NVME_SC_INVALID_FIELD | NVME_SC_DNR; break; } @@ -293,6 +297,8 @@ u16 nvmet_parse_discovery_cmd(struct nvmet_req *req) if (unlikely(!(req->sq->ctrl->csts & NVME_CSTS_RDY))) { pr_err("got cmd %d while not ready\n", cmd->common.opcode); + req->error_loc = + offsetof(struct nvme_common_command, opcode); return NVME_SC_INVALID_OPCODE | NVME_SC_DNR; } @@ -323,6 +329,8 @@ u16 nvmet_parse_discovery_cmd(struct nvmet_req *req) default: pr_err("unsupported get_log_page lid %d\n", cmd->get_log_page.lid); + req->error_loc = + offsetof(struct nvme_get_log_page_command, lid); return NVME_SC_INVALID_OPCODE | NVME_SC_DNR; } case nvme_admin_identify: @@ -335,10 +343,12 @@ u16 nvmet_parse_discovery_cmd(struct nvmet_req *req) default: pr_err("unsupported identify cns %d\n", cmd->identify.cns); + req->error_loc = offsetof(struct nvme_identify, cns); return NVME_SC_INVALID_OPCODE | NVME_SC_DNR; } default: pr_err("unhandled cmd %d\n", cmd->common.opcode); + req->error_loc = offsetof(struct nvme_common_command, opcode); return NVME_SC_INVALID_OPCODE | NVME_SC_DNR; } |