]> 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)
commitedda4aec392ed593bf122c8801e0358c88e9e276
tree2ee918eba58118a7cd86a97ba07fc26c4a743a2d
parente57b81ca321764bdc81a72bf02f90e0361984bb8
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