]> git.proxmox.com Git - ovs.git/commitdiff
datapath-windows: Fix race condition when deleting internal ports
authorAlin Gabriel Serdean <aserdean@ovn.org>
Fri, 21 Dec 2018 13:55:27 +0000 (15:55 +0200)
committerAlin Gabriel Serdean <aserdean@ovn.org>
Fri, 28 Dec 2018 14:43:48 +0000 (16:43 +0200)
We need to hold the port lock until all the operations with a port are
completed.

Found by inspection.

Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Anand Kumar <kumaranand@vmware.com>
datapath-windows/ovsext/Vport.c

index 380870a111d860db33fc5f48ea377faa024efedb..e08cb90ce7b222c8b4aa04f0b74ca03abceee2e5 100644 (file)
@@ -632,13 +632,13 @@ HvDisconnectNic(POVS_SWITCH_CONTEXT switchContext,
         OvsRemoveAndDeleteVport(NULL, switchContext, vport, FALSE, TRUE);
         OvsPostVportEvent(&event);
     }
-    NdisReleaseRWLock(switchContext->dispatchLock, &lockState);
 
     if (isInternalPort) {
         OvsInternalAdapterDown(vport->portNo, vport->netCfgInstanceId);
         OvsRemoveAndDeleteVport(NULL, switchContext, vport, TRUE, TRUE);
         OvsPostVportEvent(&event);
     }
+    NdisReleaseRWLock(switchContext->dispatchLock, &lockState);
 
 done:
     VPORT_NIC_EXIT(nicParam);