]> 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:58 +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 the passthru backend to 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/passthru.c

index cbc88acdd2336d208c3d5353131cef9b28d0a42f..3b22f4a868f43410855cd04abe4392c3264c2a04 100644 (file)
@@ -494,7 +494,7 @@ u16 nvmet_parse_passthru_admin_cmd(struct nvmet_req *req)
                return nvmet_setup_passthru_command(req);
        default:
                /* Reject commands not in the allowlist above */
-               return NVME_SC_INVALID_OPCODE | NVME_SC_DNR;
+               return nvmet_report_invalid_opcode(req);
        }
 }