From: VMware, Inc <> Date: Sat, 28 May 2011 20:18:55 +0000 (-0700) Subject: Fix race condition when disabling shared folders. X-Git-Tag: 2011.05.27-420096~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3793ddc9c9b5facf376a2625d4c2252aa9bd3daa;p=thirdparty%2Fopen-vm-tools.git Fix race condition when disabling shared folders. HGFS server must stop generating change directory notifications before releasing objects that notification delivery code may use. Moving call to stop notifications before invoking HgfsInvalidateSessionObjects instead of doing it at the very end of session deleting sequence. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/hgfsServer/hgfsServer.c b/open-vm-tools/lib/hgfsServer/hgfsServer.c index a291cafa8..f2f7fabcc 100644 --- a/open-vm-tools/lib/hgfsServer/hgfsServer.c +++ b/open-vm-tools/lib/hgfsServer/hgfsServer.c @@ -3685,10 +3685,6 @@ HgfsServerSessionDisconnect(void *clientData) // IN: session context ASSERT(session->searchArray); session->state = HGFS_SESSION_STATE_CLOSED; - - if (session->activeNotification) { - HgfsNotify_CleanupSession(session); - } } @@ -4035,6 +4031,9 @@ HgfsInvalidateSessionObjects(DblLnkLst_Links *shares, // IN: List of new shares ASSERT(session->searchArray); LOG(4, ("%s: Beginning\n", __FUNCTION__)); + if (session->activeNotification) { + HgfsNotify_CleanupSession(session); + } MXUser_AcquireExclLock(session->nodeArrayLock);