[PATCH] nvme-tcp: Use __dev_get_by_name instead dev_get_by_name for OPT_HOST_IFACE

Christoph Hellwig hch at lst.de
Fri Jun 18 06:42:44 PDT 2021


On Fri, Jun 18, 2021 at 04:39:56PM +0300, Prabhakar Kushwaha wrote:
> dev_get_by_name() finds network device by name but it also increases
> reference count.
> Increasing the ref count,
> If 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.
> 
> As a fix we will use __dev_get_by_name() which find network device by
> name without increasing any reference counter.

And when you remove it without the refcount we'll now have a stale
kernel pointer?



More information about the Linux-nvme mailing list