[libvirt] [PATCH] nwfilter: re-order lock grabbed by IP addr. learn thread
Eric Blake
eblake at redhat.com
Fri Nov 19 19:49:44 UTC 2010
On 11/18/2010 05:16 AM, Stefan Berger wrote:
> The IP address learning thread was causing a deadlock when it
> instantiated a filter while a filter update/change was ongoing. The
> reason for this was the ordering of locks due to the following calls
>
> virNWFilterUnlockFilterUpdates()
> virNWFilterPoolObjFindByName()
>
>
> + * Call this function while holding the NWFilter filter update lock
> static int
> __virNWFilterInstantiateFilter(virConnectPtr conn,
I'm assuming that's a bogus line in your patch,
> bool teardownOld,
> @@ -823,23 +822,30 @@ _virNWFilterInstantiateFilter(virConnect
> ? net->data.direct.linkdev
> : NULL;
> int ifindex;
> + int rc;
>
> if (ifaceGetIndex(true, net->ifname, &ifindex))
> return 1;
...
> + virNWFilterLockFilterUpdates();
> +
> + rc = __virNWFilterInstantiateFilter(conn,
...especially given the fact that you grab the lock here, so
__virNWFilterInstantiateFilter should NOT have the filter update lock in
the caller.
ACK, once you fix that compilation error due to the stray line.
--
Eric Blake eblake at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101119/f409f4b4/attachment-0001.sig>
More information about the libvir-list
mailing list