[ovs-dev] [PATCH] dpif-netdev: fix dp_netdev_free()

Pravin Shelar pshelar at nicira.com
Tue Sep 2 20:39:17 UTC 2014


On Fri, Aug 29, 2014 at 4:52 PM, Daniele Di Proietto
<ddiproietto at vmware.com> wrote:
> dp_netdev_free() must free 'dp->upcall_rwlock', but when upcalls are disabled
> (if the datapath is being freed upcalls should be disabled) 'dp->upcall_rwlock'
> is taken and freeing it causes an assertion to fail.
>
> This commit takes makes sure that the upcalls are disabled and releases
> 'dp->upcall_rwlock' before freeing it. A simple testcase is added to detect the
> failure.
> ---
>  lib/dpif-netdev.c    | 8 ++++++++
>  tests/dpif-netdev.at | 8 ++++++++
>  2 files changed, 16 insertions(+)
>
> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> index 3d09326..6db325f 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> @@ -513,6 +513,7 @@ dpif_netdev_open(const struct dpif_class *class, const char *name,
>  static void
>  dp_netdev_free(struct dp_netdev *dp)
>      OVS_REQUIRES(dp_netdev_mutex)
> +    OVS_NO_THREAD_SAFETY_ANALYSIS
I am not sure about these two annotations, how does it work in this case?



More information about the dev mailing list