nvme-fc: fix numa_node when dev is null
Subsystems (2)
PATCH 1/1 nvme-fc: fix numa_node when dev is null
A recent change added a numa_node field to the nvme controller and has the transport assign the node using dev_to_node(). However, fcloop registers with a NULL device struct, so the dev_to_node() call oops.
Revise the assignment to assign no node when device struct is null.
--- drivers/nvme/host/fc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/host/fc.c +2 -1
@@ -3017,7 +3017,8 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, ctrl->ctrl.opts = opts; ctrl->ctrl.nr_reconnects =0 ; - ctrl->ctrl.numa_node =dev_to_node (lport->dev); + ctrl->ctrl.numa_node = (lport->dev) ? +dev_to_node (lport->dev) :NUMA_NO_NODE ;INIT_LIST_HEAD (&ctrl->ctrl_list); ctrl->lport = lport; ctrl->rport = rport;
Signature · 1 line
2.13.7
Sagi Grimberg
maintainerPATCH 1/1 nvme-fc: fix numa_node when dev is null
Quoted 10 lines · James Smart
A recent change added a
numa_nodefield to the nvme controller and has the transport assign the node usingdev_to_node(). However, fcloop registers with a NULL device struct, so thedev_to_node()call oops.Revise the assignment to assign no node when device struct is null.
Fixes 103e515efa89b ("nvme: add a numa_node field to struct nvme_ctrl")Reported-by Mike Snitzer <snitzer at redhat.com>Signed-off-by James Smart <jsmart2021 at gmail.com>
Thanks James.
PATCH 1/1 nvme-fc: fix numa_node when dev is null
In reply to James SmartQuoted 20 lines · James Smart
A recent change added a
numa_nodefield to the nvme controller and has the transport assign the node usingdev_to_node(). However, fcloop registers with a NULL device struct, so thedev_to_node()call oops.Revise the assignment to assign no node when device struct is null.
Fixes 103e515efa89b ("nvme: add a numa_node field to struct nvme_ctrl")Reported-by Mike Snitzer <snitzer at redhat.com>Signed-off-by James Smart <jsmart2021 at gmail.com>--- drivers/nvme/host/fc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/nvme/host/fc.c +0
-0
drivers/nvme/host/fc.c nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, · line 3024
Quoted 9 lines
drivers/nvme/host/fc.c +2
-1@@ -3017,7 +3017,8 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, ctrl->ctrl.opts = opts; ctrl->ctrl.nr_reconnects =0 ; - ctrl->ctrl.numa_node =dev_to_node (lport->dev); + ctrl->ctrl.numa_node = (lport->dev) ? +dev_to_node (lport->dev) :NUMA_NO_NODE ;INIT_LIST_HEAD (&ctrl->ctrl_list); ctrl->lport = lport; ctrl->rport = rport;
Cheers,
Hannes
Signature · 5 lines
Dr. Hannes Reinecke Teamlead Storage & Networking hare at suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg GF: F. Imend?rffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG N?rnberg)
Christoph Hellwig
AppliedPATCH 1/1 nvme-fc: fix numa_node when dev is null
In reply to James SmartThanks,
applied to nvme-5.1 with a tiny codingstyle fixup.