]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-tcp: use __dev_get_by_name instead dev_get_by_name for OPT_HOST_IFACE
authorPrabhakar Kushwaha <pkushwaha@marvell.com>
Tue, 13 Jul 2021 09:31:56 +0000 (11:31 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 13 Jul 2021 09:34:24 +0000 (11:34 +0200)
commitc95565218d16aea50d3217c9100d57fa4d1e6b08
tree31e2f7b0db1760bf36a0a90f3af6d502745dea85
parentbea043b6c70b9874869134302a7b416d20a87518
nvme-tcp: use __dev_get_by_name instead dev_get_by_name for OPT_HOST_IFACE

dev_get_by_name() finds network device by name but it also increases the
reference count.

If a nvme-tcp queue is present and the network device driver is removed
before nvme_tcp, we will face the following continuous log:

  "kernel:unregister_netdevice: waiting for <eth> to become free. Usage count = 2"

And rmmod further halts. Similar case arises during reboot/shutdown
with nvme-tcp queue present and both never completes.

To fix this, use __dev_get_by_name() which finds network device by
name without increasing any reference counter.

Fixes: c639ad736211 ("nvme-tcp: allow selecting the network interface for connections")
Signed-off-by: Omkar Kulkarni <okulkarni@marvell.com>
Signed-off-by: Shai Malin <smalin@marvell.com>
Signed-off-by: Prabhakar Kushwaha <pkushwaha@marvell.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
[hch: remove the ->ndev member entirely]
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/tcp.c