[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] nwfilter: re-order lock grabbed by IP addr. learn thread

On 11/19/2010 02:49 PM, Eric Blake wrote:
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


+ * 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,
Yes, incomplete conversion from // to /* style comment. Fixed.
                                 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.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]