Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric Dumazet and committed by
David S. Miller
e4a7b93b 840a185d

+4 -4
+4 -4
drivers/net/bonding/bond_main.c
··· 3209 3209 #ifdef CONFIG_PROC_FS 3210 3210 3211 3211 static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos) 3212 - __acquires(&dev_base_lock) 3212 + __acquires(RCU) 3213 3213 __acquires(&bond->lock) 3214 3214 { 3215 3215 struct bonding *bond = seq->private; ··· 3218 3218 int i; 3219 3219 3220 3220 /* make sure the bond won't be taken away */ 3221 - read_lock(&dev_base_lock); 3221 + rcu_read_lock(); 3222 3222 read_lock(&bond->lock); 3223 3223 3224 3224 if (*pos == 0) ··· 3248 3248 3249 3249 static void bond_info_seq_stop(struct seq_file *seq, void *v) 3250 3250 __releases(&bond->lock) 3251 - __releases(&dev_base_lock) 3251 + __releases(RCU) 3252 3252 { 3253 3253 struct bonding *bond = seq->private; 3254 3254 3255 3255 read_unlock(&bond->lock); 3256 - read_unlock(&dev_base_lock); 3256 + rcu_read_unlock(); 3257 3257 } 3258 3258 3259 3259 static void bond_info_show_master(struct seq_file *seq)