summaryrefslogtreecommitdiff
path: root/drivers/net/bonding/bond_procfs.c
diff options
context:
space:
mode:
authordingtianhong <dingtianhong@huawei.com>2014-02-21 16:08:53 +0800
committerDavid S. Miller <davem@davemloft.net>2014-02-24 18:28:23 -0500
commit4335d60e5e271497116fd77ed68dacca7cfb1548 (patch)
tree609b8f5f80fe2d3c5d115c3885ed5d51193c40f2 /drivers/net/bonding/bond_procfs.c
parent827418081ab177b82ff3032277fca32c3ecc5dc3 (diff)
downloadlwn-4335d60e5e271497116fd77ed68dacca7cfb1548.tar.gz
lwn-4335d60e5e271497116fd77ed68dacca7cfb1548.zip
bonding: use rcu_dereference() to access curr_active_slave
The bond_info_show_master already in RCU read-side critical section, and the we access curr_active_slave without the curr_slave_lock, we could not sure whether the curr_active_slave will be changed during the processing, so use RCU to protected the pointer. Cc: Jay Vosburgh <fubar@us.ibm.com> Cc: Veaceslav Falico <vfalico@redhat.com> Cc: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_procfs.c')
-rw-r--r--drivers/net/bonding/bond_procfs.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
index 434df7360999..588cf39d832c 100644
--- a/drivers/net/bonding/bond_procfs.c
+++ b/drivers/net/bonding/bond_procfs.c
@@ -69,9 +69,7 @@ static void bond_info_show_master(struct seq_file *seq)
struct slave *curr;
int i;
- read_lock(&bond->curr_slave_lock);
- curr = bond->curr_active_slave;
- read_unlock(&bond->curr_slave_lock);
+ curr = rcu_dereference(bond->curr_active_slave);
seq_printf(seq, "Bonding Mode: %s",
bond_mode_name(bond->params.mode));