# Re: \[PATCH net 4/5\] openvswitch: Fix ovs\_flow\_free() ovs-lock assert.

- From: Sergei Shtylyov \<hidden\>
- Date: 2014-02-03 16:42:06 
- List: netdev
- Page: https://ratatoskr.run/netdev/2014/02/10946809

```text
Hello.

On 03-02-2014 5:08, Jesse Gross wrote:

> From: Pravin B Shelar <redacted>

> 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 <redacted>
> Signed-off-by: Jesse Gross <redacted>
> ---
>   net/openvswitch/flow_table.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)

> diff --git a/net/openvswitch/flow_table.c b/net/openvswitch/flow_table.c
> index bd14052..ad0bda0 100644
> --- a/net/openvswitch/flow_table.c
> +++ b/net/openvswitch/flow_table.c
> @@ -158,11 +158,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. */

   Networking multi-line comment style is:

/* bla
 * bla
 */

WBR, Sergei
```
