Skip to content

Commit 6494842

Browse files
hao022davem330
authored andcommitted
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]>
1 parent c427bfe commit 6494842

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

net/openvswitch/flow_table.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,12 +462,14 @@ static void flow_table_copy_flows(struct table_instance *old,
462462
struct hlist_head *head = &old->buckets[i];
463463

464464
if (ufid)
465-
hlist_for_each_entry(flow, head,
466-
ufid_table.node[old_ver])
465+
hlist_for_each_entry_rcu(flow, head,
466+
ufid_table.node[old_ver],
467+
lockdep_ovsl_is_held())
467468
ufid_table_instance_insert(new, flow);
468469
else
469-
hlist_for_each_entry(flow, head,
470-
flow_table.node[old_ver])
470+
hlist_for_each_entry_rcu(flow, head,
471+
flow_table.node[old_ver],
472+
lockdep_ovsl_is_held())
471473
table_instance_insert(new, flow);
472474
}
473475

0 commit comments

Comments
 (0)