nvme-fc: set numa_node after nvme_init_ctrl
authorKeith Busch <kbusch@kernel.org>
Mon, 18 Dec 2023 23:22:24 +0000 (15:22 -0800)
committerKeith Busch <kbusch@kernel.org>
Thu, 21 Dec 2023 17:19:01 +0000 (09:19 -0800)
nvme_init_ctrl() resets numa_node to NUMA_NO_NODE, so be sure to set the
desired value after that function call so it won't be overwritten.

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/fc.c

index 9f9a3b35dc64d3ea03c6fea85599279e2b46b3da..05c3159d42e99d69a55645d01df63de87dfd8fb4 100644 (file)
@@ -3509,10 +3509,6 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,
 
        ctrl->ctrl.opts = opts;
        ctrl->ctrl.nr_reconnects = 0;
-       if (lport->dev)
-               ctrl->ctrl.numa_node = dev_to_node(lport->dev);
-       else
-               ctrl->ctrl.numa_node = NUMA_NO_NODE;
        INIT_LIST_HEAD(&ctrl->ctrl_list);
        ctrl->lport = lport;
        ctrl->rport = rport;
@@ -3557,6 +3553,8 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,
        ret = nvme_init_ctrl(&ctrl->ctrl, dev, &nvme_fc_ctrl_ops, 0);
        if (ret)
                goto out_free_queues;
+       if (lport->dev)
+               ctrl->ctrl.numa_node = dev_to_node(lport->dev);
 
        /* at this point, teardown path changes to ref counting on nvme ctrl */