projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6c5d171
)
bonding: no longer use RTNL in bonding_show_slaves()
author
Eric Dumazet
<edumazet@google.com>
Mon, 8 Apr 2024 19:04:36 +0000
(19:04 +0000)
committer
Jakub Kicinski
<kuba@kernel.org>
Wed, 10 Apr 2024 00:31:45 +0000
(17:31 -0700)
Slave devices are already RCU protected, simply
switch to bond_for_each_slave_rcu(),
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Link:
https://lore.kernel.org/r/20240408190437.2214473-3-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/bonding/bond_sysfs.c
patch
|
blob
|
history
diff --git
a/drivers/net/bonding/bond_sysfs.c
b/drivers/net/bonding/bond_sysfs.c
index 9132033f85fb0e33093e97c55f885a997c95cb4a..75ee7ca369034ef6fa58fc9399b566dd7044fedc 100644
(file)
--- a/
drivers/net/bonding/bond_sysfs.c
+++ b/
drivers/net/bonding/bond_sysfs.c
@@
-170,10
+170,9
@@
static ssize_t bonding_show_slaves(struct device *d,
struct slave *slave;
int res = 0;
- if (!rtnl_trylock())
- return restart_syscall();
+ rcu_read_lock();
- bond_for_each_slave(bond, slave, iter) {
+ bond_for_each_slave
_rcu
(bond, slave, iter) {
if (res > (PAGE_SIZE - IFNAMSIZ)) {
/* not enough space for another interface name */
if ((PAGE_SIZE - res) > 10)
@@
-184,7
+183,7
@@
static ssize_t bonding_show_slaves(struct device *d,
res += sysfs_emit_at(buf, res, "%s ", slave->dev->name);
}
- r
tnl
_unlock();
+ r
cu_read
_unlock();
if (res)
buf[res-1] = '\n'; /* eat the leftover space */