]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commita39bd166d125214d556616aa334b6342f691cf2d
tree2ee918eba58118a7cd86a97ba07fc26c4a743a2d
parent05e3bb81530f43b4771f65b797027e65b9460f7e
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