nvmet: fix Identify Controller handling
authorDamien Le Moal <damien.lemoal@opensource.wdc.com>
Wed, 15 Mar 2023 10:59:36 +0000 (19:59 +0900)
committerChristoph Hellwig <hch@lst.de>
Thu, 13 Apr 2023 06:55:03 +0000 (08:55 +0200)
The identify command with cns set to NVME_ID_CNS_CTRL does not depend on
the command set. The execution of this command should thus not look at
the csi specified in the command. Simplify nvmet_execute_identify() to
directly call nvmet_execute_identify_ctrl() without the csi switch-case.

Fixes: ab5d0b38c047 ("nvmet: add Command Set Identifier support")
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Tested-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/admin-cmd.c

index a982f925dfcef48c24f06b904fcbfb81c6fcf846..a747c69074daf0834989d5ef6daa22c482612fbd 100644 (file)
@@ -705,11 +705,8 @@ static void nvmet_execute_identify(struct nvmet_req *req)
                }
                break;
        case NVME_ID_CNS_CTRL:
-               switch (req->cmd->identify.csi) {
-               case NVME_CSI_NVM:
-                       return nvmet_execute_identify_ctrl(req);
-               }
-               break;
+               nvmet_execute_identify_ctrl(req);
+               return;
        case NVME_ID_CNS_CS_CTRL:
                if (IS_ENABLED(CONFIG_BLK_DEV_ZONED)) {
                        switch (req->cmd->identify.csi) {