From: Pravin B Shelar Date: Fri, 31 Jan 2014 17:43:23 +0000 (-0800) Subject: openvswitch: Fix ovs_flow_free() ovs-lock assert. X-Git-Tag: v3.14-rc3~36^2~48^2~1 X-Git-Url: http://git.cascardo.info/?a=commitdiff_plain;h=e4c6d7595403e943a3afc334eb8c0efcd840043a;p=cascardo%2Flinux.git openvswitch: 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 Signed-off-by: Jesse Gross --- diff --git a/net/openvswitch/flow_table.c b/net/openvswitch/flow_table.c index bd14052ed342..3c268b3d71c3 100644 --- a/net/openvswitch/flow_table.c +++ b/net/openvswitch/flow_table.c @@ -158,11 +158,13 @@ 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--;