Re: [PATCH] nvme-tcp: Use __dev_get_by_name instead dev_get_by_name for OPT_HOST_IFACE
From: Prabhakar Kushwaha <hidden>
Date: 2021-07-11 13:18:37
Hi Christoph, On Thu, Jun 24, 2021 at 12:05 PM Christoph Hellwig [off-list ref] wrote:
I've applied the slightly updated version below to make it a little
more clear what is going on:
---
From 9de7d173c10b6be09fe9d5b7010ef182465897a1 Mon Sep 17 00:00:00 2001
From: Prabhakar Kushwaha <redacted>
Date: Fri, 18 Jun 2021 16:39:56 +0300
Subject: 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: 3ede8f72a9a2 ("nvme-tcp: allow selecting the network interface for connections")
Signed-off-by: Omkar Kulkarni <redacted>
Signed-off-by: Shai Malin <redacted>
Signed-off-by: Prabhakar Kushwaha <redacted>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
[hch: remove the ->ndev member entirely]
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
I am not finding this patch on updated "branch nvme-5.14" having the
latest commit 0755d3be2d9b("nvme-tcp: can't set sk_user_data without
write_lock").
Am I missing something? Please note, earlier it was there with commit
ff5af4bfb6af.
Issue can still be found on the nvme-5.14 branch (top of the tree).
Are you planning to fix this problem using any other approach?
--pk
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme