Skip to content

Commit 906dbc4

Browse files
guixinliu1995keithbusch
authored andcommitted
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 <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent 2fcd3ab commit 906dbc4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/nvme/target/configfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,7 @@ static ssize_t nvmet_subsys_attr_cntlid_min_store(struct config_item *item,
12741274
return -EINVAL;
12751275

12761276
down_write(&nvmet_config_sem);
1277-
if (cntlid_min >= to_subsys(item)->cntlid_max)
1277+
if (cntlid_min > to_subsys(item)->cntlid_max)
12781278
goto out_unlock;
12791279
to_subsys(item)->cntlid_min = cntlid_min;
12801280
up_write(&nvmet_config_sem);
@@ -1304,7 +1304,7 @@ static ssize_t nvmet_subsys_attr_cntlid_max_store(struct config_item *item,
13041304
return -EINVAL;
13051305

13061306
down_write(&nvmet_config_sem);
1307-
if (cntlid_max <= to_subsys(item)->cntlid_min)
1307+
if (cntlid_max < to_subsys(item)->cntlid_min)
13081308
goto out_unlock;
13091309
to_subsys(item)->cntlid_max = cntlid_max;
13101310
up_write(&nvmet_config_sem);

0 commit comments

Comments
 (0)