]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
nvmet: use invalid cmd opcode helper
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Wed, 10 Feb 2021 05:47:57 +0000 (21:47 -0800)
committerChristoph Hellwig <hch@lst.de>
Wed, 10 Feb 2021 15:38:05 +0000 (16:38 +0100)
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>
drivers/nvme/target/io-cmd-file.c

index 0abbefd9925e35701ef889a428ec40a2bac3f3c2..715d4376c997975a743bedc908218b23325a7653 100644 (file)
@@ -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);
        }
 }