From: Pravin B Shelar Date: Tue, 28 Jan 2014 02:18:33 +0000 (-0800) Subject: datapath: Fix ovs_flow_free() ovs-lock assert. X-Git-Tag: sliver-openvswitch-2.1.90-1~8^2~22 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=b1705c56f366d7dd47c60fed13229db022ce3198;p=sliver-openvswitch.git datapath: Fix ovs_flow_free() ovs-lock assert. ovs_flow_free() is not called under ovs-lock during packet execute path (ovs_packet_cmd_execute()). Since packet execute does not touch flow->mask, there is no need to take that lock either. So move assert in case where flow->mask is checked. Found by code inspection. Signed-off-by: Pravin B Shelar Acked-by: Andy Zhou Acked-by: Jesse Gross --- diff --git a/datapath/flow_table.c b/datapath/flow_table.c index c0ba8ef54..20854acdc 100644 --- a/datapath/flow_table.c +++ b/datapath/flow_table.c @@ -169,11 +169,12 @@ void ovs_flow_free(struct sw_flow *flow, bool deferred) if (!flow) return; - ASSERT_OVSL(); - if (flow->mask) { struct sw_flow_mask *mask = flow->mask; + /* ovs-lock is required to protect mask-refcount and + * mask list. */ + ASSERT_OVSL(); BUG_ON(!mask->ref_count); mask->ref_count--;