Skip to content

Commit

Permalink
datapath-windows: Fix race condition when deleting internal ports
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
aserdean committed Dec 28, 2018
1 parent 4df9269 commit d4484c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datapath-windows/ovsext/Vport.c
Expand Up @@ -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);
Expand Down

0 comments on commit d4484c2

Please sign in to comment.