summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGuixin Liu <kanie@linux.alibaba.com>2023-12-13 14:32:49 +0800
committerKeith Busch <kbusch@kernel.org>2023-12-13 14:53:33 -0800
commit906dbc47b1d540961a2ffddc7a095196d1a39b93 (patch)
treeb46477a7c13043f735fb5bf15dc9b0035db6fe2d /drivers
parent2fcd3ab398260a113fd4434b4d72929066c73121 (diff)
downloadlinux-stable-906dbc47b1d540961a2ffddc7a095196d1a39b93.tar.gz
linux-stable-906dbc47b1d540961a2ffddc7a095196d1a39b93.tar.bz2
linux-stable-906dbc47b1d540961a2ffddc7a095196d1a39b93.zip
nvmet: allow identical cntlid_min and cntlid_max settings
When the user wants to restrict to only creating one controller, they can set cntlid_min and cntlid_max to the same value. Signed-off-by: Guixin Liu <kanie@linux.alibaba.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/nvme/target/configfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c
index e307a044b1a1..bd514d4c4a5b 100644
--- a/drivers/nvme/target/configfs.c
+++ b/drivers/nvme/target/configfs.c
@@ -1274,7 +1274,7 @@ static ssize_t nvmet_subsys_attr_cntlid_min_store(struct config_item *item,
return -EINVAL;
down_write(&nvmet_config_sem);
- if (cntlid_min >= to_subsys(item)->cntlid_max)
+ if (cntlid_min > to_subsys(item)->cntlid_max)
goto out_unlock;
to_subsys(item)->cntlid_min = cntlid_min;
up_write(&nvmet_config_sem);
@@ -1304,7 +1304,7 @@ static ssize_t nvmet_subsys_attr_cntlid_max_store(struct config_item *item,
return -EINVAL;
down_write(&nvmet_config_sem);
- if (cntlid_max <= to_subsys(item)->cntlid_min)
+ if (cntlid_max < to_subsys(item)->cntlid_min)
goto out_unlock;
to_subsys(item)->cntlid_max = cntlid_max;
up_write(&nvmet_config_sem);