]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fix race condition when disabling shared folders.
authorVMware, Inc <>
Sat, 28 May 2011 20:18:55 +0000 (13:18 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Sat, 28 May 2011 20:18:55 +0000 (13:18 -0700)
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 <mvanzin@vmware.com>
open-vm-tools/lib/hgfsServer/hgfsServer.c

index a291cafa8255a5b07ecf7f5da57f34ed38ce8bd2..f2f7fabcc71a04508e7900c5f3e35ee9afc2140e 100644 (file)
@@ -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);