All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme-fc: fix numa_node when dev is null
@ 2019-03-01 21:19 James Smart
  2019-03-01 22:05 ` Sagi Grimberg
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: James Smart @ 2019-03-01 21:19 UTC (permalink / raw)


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.

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(-)

diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index ba8f2a9cbdaf..865dc0637dbe 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -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;
-- 
2.13.7

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] nvme-fc: fix numa_node when dev is null
  2019-03-01 21:19 [PATCH] nvme-fc: fix numa_node when dev is null James Smart
@ 2019-03-01 22:05 ` Sagi Grimberg
  2019-03-02  5:29 ` Mike Snitzer
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Sagi Grimberg @ 2019-03-01 22:05 UTC (permalink / raw)


Reviewed-by: Sagi Grimberg <sagi at grimberg.me>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* nvme-fc: fix numa_node when dev is null
  2019-03-01 21:19 [PATCH] nvme-fc: fix numa_node when dev is null James Smart
  2019-03-01 22:05 ` Sagi Grimberg
@ 2019-03-02  5:29 ` Mike Snitzer
  2019-03-04 12:33 ` [PATCH] " Hannes Reinecke
  2019-03-12 15:01 ` Christoph Hellwig
  3 siblings, 0 replies; 5+ messages in thread
From: Mike Snitzer @ 2019-03-02  5:29 UTC (permalink / raw)


On Fri, Mar 01 2019 at  4:19pm -0500,
James Smart <jsmart2021@gmail.com> wrote:

> 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.
> 
> 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>

Reviewed-by: Mike Snitzer <snitzer at redhat.com>

Thanks James.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] nvme-fc: fix numa_node when dev is null
  2019-03-01 21:19 [PATCH] nvme-fc: fix numa_node when dev is null James Smart
  2019-03-01 22:05 ` Sagi Grimberg
  2019-03-02  5:29 ` Mike Snitzer
@ 2019-03-04 12:33 ` Hannes Reinecke
  2019-03-12 15:01 ` Christoph Hellwig
  3 siblings, 0 replies; 5+ messages in thread
From: Hannes Reinecke @ 2019-03-04 12:33 UTC (permalink / raw)


On 3/1/19 10:19 PM, James Smart wrote:
> 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.
> 
> 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(-)
> 
> diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
> index ba8f2a9cbdaf..865dc0637dbe 100644
> --- a/drivers/nvme/host/fc.c
> +++ b/drivers/nvme/host/fc.c
> @@ -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;
> 
Reviewed-by: Hannes Reinecke <hare at suse.com>

Cheers,

Hannes
-- 
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)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] nvme-fc: fix numa_node when dev is null
  2019-03-01 21:19 [PATCH] nvme-fc: fix numa_node when dev is null James Smart
                   ` (2 preceding siblings ...)
  2019-03-04 12:33 ` [PATCH] " Hannes Reinecke
@ 2019-03-12 15:01 ` Christoph Hellwig
  3 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2019-03-12 15:01 UTC (permalink / raw)


Thanks,

applied to nvme-5.1 with a tiny codingstyle fixup.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-03-12 15:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-01 21:19 [PATCH] nvme-fc: fix numa_node when dev is null James Smart
2019-03-01 22:05 ` Sagi Grimberg
2019-03-02  5:29 ` Mike Snitzer
2019-03-04 12:33 ` [PATCH] " Hannes Reinecke
2019-03-12 15:01 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.