Commit e4a7b93b authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

bonding: remove dev_base_lock use

bond_info_seq_start() uses a read_lock(&dev_base_lock) to make sure
device doesn’t disappear. Same goal can be achieved using RCU.
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 840a185d
...@@ -3209,7 +3209,7 @@ void bond_activebackup_arp_mon(struct work_struct *work) ...@@ -3209,7 +3209,7 @@ void bond_activebackup_arp_mon(struct work_struct *work)
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos) static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos)
__acquires(&dev_base_lock) __acquires(RCU)
__acquires(&bond->lock) __acquires(&bond->lock)
{ {
struct bonding *bond = seq->private; struct bonding *bond = seq->private;
...@@ -3218,7 +3218,7 @@ static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos) ...@@ -3218,7 +3218,7 @@ static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos)
int i; int i;
/* make sure the bond won't be taken away */ /* make sure the bond won't be taken away */
read_lock(&dev_base_lock); rcu_read_lock();
read_lock(&bond->lock); read_lock(&bond->lock);
if (*pos == 0) if (*pos == 0)
...@@ -3248,12 +3248,12 @@ static void *bond_info_seq_next(struct seq_file *seq, void *v, loff_t *pos) ...@@ -3248,12 +3248,12 @@ static void *bond_info_seq_next(struct seq_file *seq, void *v, loff_t *pos)
static void bond_info_seq_stop(struct seq_file *seq, void *v) static void bond_info_seq_stop(struct seq_file *seq, void *v)
__releases(&bond->lock) __releases(&bond->lock)
__releases(&dev_base_lock) __releases(RCU)
{ {
struct bonding *bond = seq->private; struct bonding *bond = seq->private;
read_unlock(&bond->lock); read_unlock(&bond->lock);
read_unlock(&dev_base_lock); rcu_read_unlock();
} }
static void bond_info_show_master(struct seq_file *seq) static void bond_info_show_master(struct seq_file *seq)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment