summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/target/admin-cmd.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2021-09-22 08:35:22 +0200
committerChristoph Hellwig <hch@lst.de>2021-10-20 19:16:02 +0200
commitd3aef70124e7f69975eabeb340866bc91672532d (patch)
tree49ac7eb29f0f2994e0ea48729940ff9a2f24a54a /drivers/nvme/target/admin-cmd.c
parentnvmet: add nvmet_is_disc_subsys() helper (diff)
downloadlinux-d3aef70124e7f69975eabeb340866bc91672532d.tar.xz
linux-d3aef70124e7f69975eabeb340866bc91672532d.zip
nvmet: set 'CNTRLTYPE' in the identify controller data
Set the correct 'CNTRLTYPE' field in the identify controller data. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/target/admin-cmd.c')
-rw-r--r--drivers/nvme/target/admin-cmd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
index b653ea4244fe..3616a06f7836 100644
--- a/drivers/nvme/target/admin-cmd.c
+++ b/drivers/nvme/target/admin-cmd.c
@@ -374,6 +374,11 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req)
id->rab = 6;
+ if (nvmet_is_disc_subsys(ctrl->subsys))
+ id->cntrltype = NVME_CTRL_DISC;
+ else
+ id->cntrltype = NVME_CTRL_IO;
+
/*
* XXX: figure out how we can assign a IEEE OUI, but until then
* the safest is to leave it as zeroes.