File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -3037,27 +3037,32 @@ static void vxlan_flush(struct vxlan_dev *vxlan,
30373037 const struct vxlan_fdb_flush_desc * desc )
30383038{
30393039 bool match_remotes = vxlan_fdb_flush_should_match_remotes (desc );
3040- struct hlist_node * n ;
30413040 struct vxlan_fdb * f ;
30423041
3043- spin_lock_bh ( & vxlan -> hash_lock );
3044- hlist_for_each_entry_safe ( f , n , & vxlan -> fdb_list , fdb_node ) {
3042+ rcu_read_lock ( );
3043+ hlist_for_each_entry_rcu ( f , & vxlan -> fdb_list , fdb_node ) {
30453044 if (!vxlan_fdb_flush_matches (f , vxlan , desc ))
30463045 continue ;
30473046
3047+ spin_lock_bh (& vxlan -> hash_lock );
3048+ if (hlist_unhashed (& f -> fdb_node ))
3049+ goto unlock ;
3050+
30483051 if (match_remotes ) {
30493052 bool destroy_fdb = false;
30503053
30513054 vxlan_fdb_flush_match_remotes (f , vxlan , desc ,
30523055 & destroy_fdb );
30533056
30543057 if (!destroy_fdb )
3055- continue ;
3058+ goto unlock ;
30563059 }
30573060
30583061 vxlan_fdb_destroy (vxlan , f , true, true);
3062+ unlock :
3063+ spin_unlock_bh (& vxlan -> hash_lock );
30593064 }
3060- spin_unlock_bh ( & vxlan -> hash_lock );
3065+ rcu_read_unlock ( );
30613066}
30623067
30633068static const struct nla_policy vxlan_del_bulk_policy [NDA_MAX + 1 ] = {
You can’t perform that action at this time.
0 commit comments