Index: uspace/srv/vfs/vfs.c
===================================================================
--- uspace/srv/vfs/vfs.c	(revision 20614d08459f4a901de67ae98ec4a4c72e32092a)
+++ uspace/srv/vfs/vfs.c	(revision 828d21540cbb80021613fd24a5dfd84e867a1237)
@@ -57,12 +57,4 @@
 
 	/*
-	 * Initialize the table of open files.
-	 */
-	if (!vfs_conn_open_files_init()) {
-		ipc_answer_fast_0(iid, ENOMEM);
-		return;
-	}
-
-	/*
 	 * The connection was opened via the IPC_CONNECT_ME_TO call.
 	 * This call needs to be answered.
@@ -97,6 +89,11 @@
 			break;
 		case VFS_MOUNT:
+			vfs_mount(callid, &call);
+			keep_on_going = false;
+			break;
+		case VFS_OPEN:
+			vfs_open(callid, &call);
+			break;
 		case VFS_UNMOUNT:
-		case VFS_OPEN:
 		case VFS_CREATE:
 		case VFS_CLOSE:
Index: uspace/srv/vfs/vfs.h
===================================================================
--- uspace/srv/vfs/vfs.h	(revision 20614d08459f4a901de67ae98ec4a4c72e32092a)
+++ uspace/srv/vfs/vfs.h	(revision 828d21540cbb80021613fd24a5dfd84e867a1237)
@@ -176,6 +176,4 @@
 #define MAX_OPEN_FILES	128	
 
-extern bool vfs_conn_open_files_init(void);
-
 extern void vfs_register(ipc_callid_t, ipc_call_t *);
 extern void vfs_mount(ipc_callid_t, ipc_call_t *);
Index: uspace/srv/vfs/vfs_open.c
===================================================================
--- uspace/srv/vfs/vfs_open.c	(revision 20614d08459f4a901de67ae98ec4a4c72e32092a)
+++ uspace/srv/vfs/vfs_open.c	(revision 828d21540cbb80021613fd24a5dfd84e867a1237)
@@ -44,5 +44,9 @@
 #include <futex.h>
 #include <libadt/list.h>
+#include <sys/types.h>
 #include "vfs.h"
+
+/** Per-connection futex protecting the files array. */
+__thread atomic_t files_futex = FUTEX_INITIALIZER;
 
 /**
@@ -54,11 +58,23 @@
  * the functionality will stay unchanged. So unless the client knows what it is
  * doing, it should open one connection to VFS only.
+ *
+ * Allocation of the open files table is deferred until the client makes the
+ * first VFS_OPEN operation.
  */
-__thread vfs_file_t files[MAX_OPEN_FILES];
+__thread vfs_file_t *files = NULL;
 
 /** Initialize the table of open files. */
-bool vfs_conn_open_files_init(void)
+static bool vfs_conn_open_files_init(void)
 {
-	memset(files, 0, MAX_OPEN_FILES * sizeof(vfs_file_t));
+	futex_down(&files_futex);
+	if (!files) {
+		files = malloc(MAX_OPEN_FILES * sizeof(vfs_file_t));
+		if (!files) {
+			futex_up(&files_futex);
+			return false;
+		}
+		memset(files, 0, MAX_OPEN_FILES * sizeof(vfs_file_t));
+	}
+	futex_up(&files_futex);
 	return true;
 }
@@ -66,4 +82,8 @@
 void vfs_open(ipc_callid_t rid, ipc_call_t *request)
 {
+	if (!vfs_conn_open_files_init()) {
+		ipc_answer_fast_0(rid, ENOMEM);
+		return;
+	}
 }
 
