Index: /trunk/src/VBox/Additions/linux/sharedfolders/regops.c
===================================================================
--- /trunk/src/VBox/Additions/linux/sharedfolders/regops.c	(revision 39697)
+++ /trunk/src/VBox/Additions/linux/sharedfolders/regops.c	(revision 39698)
@@ -430,4 +430,7 @@
     BUG_ON(!sf_r);
 
+    /* See the smbfs source (file.c). mmap in particular can cause data to be
+     * written to the file after it is closed, which we can't cope with. */
+    filemap_write_and_wait(inode->i_mapping);
     rc = vboxCallClose(&client_handle, &sf_g->map, sf_r->handle);
     if (RT_FAILURE(rc))
