OSDN Git Service

net: core: decouple ifalias get/set from rtnl lock
authorFlorian Westphal <fw@strlen.de>
Mon, 2 Oct 2017 21:50:05 +0000 (23:50 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Oct 2017 22:56:01 +0000 (15:56 -0700)
commit6c5570016b972d9b1f0f6c2dca9cc0422b1f92bf
tree2ee918eba58118a7cd86a97ba07fc26c4a743a2d
parent4d2c0cda07448ea6980f00102dc3964eb25e241c
net: core: decouple ifalias get/set from rtnl lock

Device alias can be set by either rtnetlink (rtnl is held) or sysfs.

rtnetlink hold the rtnl mutex, sysfs acquires it for this purpose.
Add an extra mutex for it and use rcu to protect concurrent accesses.

This allows the sysfs path to not take rtnl and would later allow
to not hold it when dumping ifalias.

Based on suggestion from Eric Dumazet.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h
net/core/dev.c
net/core/net-sysfs.c
net/core/rtnetlink.c