Thread (3 messages) 3 messages, 2 authors, 2017-10-02

Re: [PATCH net-next] net: core: decouple ifalias get/set from rtnl lock

From: Florian Westphal <fw@strlen.de>
Date: 2017-10-02 09:26:38

David Miller [off-list ref] wrote:
From: Florian Westphal <fw@strlen.de>
Date: Fri, 29 Sep 2017 13:21:50 +0200
quoted
@@ -1488,7 +1484,7 @@ static void netdev_release(struct device *d)
 
 	BUG_ON(dev->reg_state != NETREG_RELEASED);
 
-	kfree(dev->ifalias);
+	kfree(rcu_access_pointer(dev->ifalias));
 	netdev_freemem(dev);
 }
 
"kfree_rcu()" at least?

If the deal is that you don't need to do and RCU free because
netdevice objects disappear synchronously, and you can therefore prove
that no RCU based async access can occur to dev->ifalias, then you
need to add a comment here.
Ok, I will add a comment.

netdev_release gets called via kobject_put() if this was last reference
to the device. At that point the device has already been removed from
all lists (and private destructor was invoked too).

Also, netdev_freemem frees the net_device memory immediately
so no other cpu is allowed to use dev at this point.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help