diff options
author | Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> | 2021-02-09 21:47:57 -0800 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2021-02-10 16:38:05 +0100 |
commit | 1c2c76136875d2329339275d431484a33dbb612d (patch) | |
tree | 49e087d1698104667a89576a9876367f20b662a3 /drivers/nvme/target | |
parent | d81d57cf1b4702b7c2fa8ce8f1d5c6961a0c20b5 (diff) |
nvmet: use invalid cmd opcode helper
In the NVMeOF block device backend, file backend, and passthru backend
we reject and report the commands if opcode is not handled.
Use the previously introduced helper in file backend to reduce the
duplicate code and make the error message uniform.
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/target')
-rw-r--r-- | drivers/nvme/target/io-cmd-file.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/nvme/target/io-cmd-file.c b/drivers/nvme/target/io-cmd-file.c index 0abbefd9925e..715d4376c997 100644 --- a/drivers/nvme/target/io-cmd-file.c +++ b/drivers/nvme/target/io-cmd-file.c @@ -400,9 +400,6 @@ u16 nvmet_file_parse_io_cmd(struct nvmet_req *req) req->execute = nvmet_file_execute_write_zeroes; return 0; default: - pr_err("unhandled cmd for file ns %d on qid %d\n", - cmd->common.opcode, req->sq->qid); - req->error_loc = offsetof(struct nvme_common_command, opcode); - return NVME_SC_INVALID_OPCODE | NVME_SC_DNR; + return nvmet_report_invalid_opcode(req); } } |