nvmet: return proper error code from discovery ctrl
[ Upstream commit 79695dcd9a ]
Return NVME_SC_INVALID_FIELD from discovery controller like normal
controller when executing identify or get log page command.
Signed-off-by: Hou Pu <houpu.main@gmail.com>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
7f9757005c
commit
9ec74da2ac
1 changed files with 4 additions and 2 deletions
|
|
@ -177,12 +177,14 @@ static void nvmet_execute_disc_get_log_page(struct nvmet_req *req)
|
|||
if (req->cmd->get_log_page.lid != NVME_LOG_DISC) {
|
||||
req->error_loc =
|
||||
offsetof(struct nvme_get_log_page_command, lid);
|
||||
status = NVME_SC_INVALID_OPCODE | NVME_SC_DNR;
|
||||
status = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Spec requires dword aligned offsets */
|
||||
if (offset & 0x3) {
|
||||
req->error_loc =
|
||||
offsetof(struct nvme_get_log_page_command, lpo);
|
||||
status = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -249,7 +251,7 @@ static void nvmet_execute_disc_identify(struct nvmet_req *req)
|
|||
|
||||
if (req->cmd->identify.cns != NVME_ID_CNS_CTRL) {
|
||||
req->error_loc = offsetof(struct nvme_identify, cns);
|
||||
status = NVME_SC_INVALID_OPCODE | NVME_SC_DNR;
|
||||
status = NVME_SC_INVALID_FIELD | NVME_SC_DNR;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue