mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
net: openvswitch: use hlist_for_each_entry_rcu instead of hlist_for_each_entry
The struct sw_flow is protected by RCU, when traversing them, use hlist_for_each_entry_rcu. Signed-off-by: Tonghao Zhang <[email protected]> Tested-by: Greg Rose <[email protected]> Reviewed-by: Greg Rose <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
1 parent
c427bfec18
commit
64948427a6
1 file changed
+6
-4
@@ -462,12 +462,14 @@ static void flow_table_copy_flows(struct table_instance *old,
|
||||
struct hlist_head *head = &old->buckets[i];
|
||||
|
||||
if (ufid)
|
||||
hlist_for_each_entry(flow, head,
|
||||
ufid_table.node[old_ver])
|
||||
hlist_for_each_entry_rcu(flow, head,
|
||||
ufid_table.node[old_ver],
|
||||
lockdep_ovsl_is_held())
|
||||
ufid_table_instance_insert(new, flow);
|
||||
else
|
||||
hlist_for_each_entry(flow, head,
|
||||
flow_table.node[old_ver])
|
||||
hlist_for_each_entry_rcu(flow, head,
|
||||
flow_table.node[old_ver],
|
||||
lockdep_ovsl_is_held())
|
||||
table_instance_insert(new, flow);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user