]> git.proxmox.com Git - ovs.git/commitdiff
datapath-windows: Fix race condition during port creation
authorSairam Venugopal <vsairam@vmware.com>
Tue, 26 Feb 2019 22:53:35 +0000 (14:53 -0800)
committerAlin Gabriel Serdean <aserdean@ovn.org>
Wed, 13 Mar 2019 11:18:31 +0000 (13:18 +0200)
Hold the dispatch lock until port-add operations are completed.

Found by inspection.

Signed-off-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
datapath-windows/ovsext/Vport.c

index e08cb90ce7b222c8b4aa04f0b74ca03abceee2e5..bb83c2235926ff56e2af3bf608fc5db69fa7fef5 100644 (file)
@@ -452,12 +452,11 @@ HvConnectNic(POVS_SWITCH_CONTEXT switchContext,
     vport->ovsState = OVS_STATE_CONNECTED;
     vport->nicState = NdisSwitchNicStateConnected;
 
-    NdisReleaseRWLock(switchContext->dispatchLock, &lockState);
-
     if (nicParam->NicType == NdisSwitchNicTypeInternal) {
         OvsInternalAdapterUp(vport->portNo, &vport->netCfgInstanceId);
     }
 
+    NdisReleaseRWLock(switchContext->dispatchLock, &lockState);
 done:
     VPORT_NIC_EXIT(nicParam);
 }