diff options
author | Christoph Hellwig <hch@lst.de> | 2022-09-20 18:26:18 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2022-09-27 15:44:17 +0300 |
commit | 379e0df5ab2c46e52e7ca2273d1238526631aa4f (patch) | |
tree | 4da9063b6657d16734cb563165a4a58eb8f924e7 /drivers/nvme/target/loop.c | |
parent | 6dfba1c09c109f4a6ca12e156dbdbe27e0924862 (diff) | |
download | linux-379e0df5ab2c46e52e7ca2273d1238526631aa4f.tar.xz |
nvme-loop: initialize sqsize later
Defer initializing the sqsize field from the options until it has been
capped by MAXCMD.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Diffstat (limited to 'drivers/nvme/target/loop.c')
-rw-r--r-- | drivers/nvme/target/loop.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c index 9750a7fca268..ed6d36eb7d29 100644 --- a/drivers/nvme/target/loop.c +++ b/drivers/nvme/target/loop.c @@ -601,7 +601,6 @@ static struct nvme_ctrl *nvme_loop_create_ctrl(struct device *dev, ret = -ENOMEM; - ctrl->ctrl.sqsize = opts->queue_size - 1; ctrl->ctrl.kato = opts->kato; ctrl->port = nvme_loop_find_port(&ctrl->ctrl); @@ -621,6 +620,7 @@ static struct nvme_ctrl *nvme_loop_create_ctrl(struct device *dev, opts->queue_size, ctrl->ctrl.maxcmd); opts->queue_size = ctrl->ctrl.maxcmd; } + ctrl->ctrl.sqsize = opts->queue_size - 1; if (opts->nr_io_queues) { ret = nvme_loop_create_io_queues(ctrl); |