Index: uspace/srv/vfs/vfs_mount.c
===================================================================
--- uspace/srv/vfs/vfs_mount.c	(revision 4b11571f9ef913e6736d4f664b1c4964eebb2677)
+++ uspace/srv/vfs/vfs_mount.c	(revision c9957b65b4d97076c3d033571ea3018fa89a1953)
@@ -80,10 +80,11 @@
 	 */
 
-	/*
-	 * Now, we expect the client to send us data with the name of the file
-	 * system and the path of the mountpoint.
-	 */
 	ipc_callid_t callid;
 	size_t size;
+
+	/*
+	 * Now, we expect the client to send us data with the name of the file
+	 * system.
+	 */
 	if (!ipc_data_receive(&callid, NULL, &size)) {
 		ipc_answer_0(callid, EINVAL);
@@ -93,17 +94,49 @@
 
 	/*
-	 * There is no sense in receiving data that can't hold a single
-	 * character of path. We won't accept data that exceed certain limits
-	 * either.
-	 */
-	if ((size < FS_NAME_MAXLEN + 1) ||
-	    (size > FS_NAME_MAXLEN + MAX_PATH_LEN)) {
-		ipc_answer_0(callid, EINVAL);
-		ipc_answer_0(rid, EINVAL);
-		return;
-	}
-
-	/*
-	 * Allocate buffer for the data being received.
+	 * Don't receive more than is necessary for storing a full file system
+	 * name.
+	 */
+	if (size < 1 || size > FS_NAME_MAXLEN) {
+		ipc_answer_0(callid, EINVAL);
+		ipc_answer_0(rid, EINVAL);
+		return;
+	}
+
+	/*
+	 * Deliver the file system name.
+	 */
+	char fs_name[FS_NAME_MAXLEN + 1];
+	(void) ipc_data_deliver(callid, fs_name, size);
+	fs_name[size] = '\0';
+	
+	/*
+	 * Check if we know a file system with the same name as is in fs_name.
+	 * This will also give us its file system handle.
+	 */
+	int fs_handle = fs_name_to_handle(fs_name, true);
+	if (!fs_handle) {
+		ipc_answer_0(rid, ENOENT);
+		return;
+	}
+
+	/*
+	 * Now, we want the client to send us the mount point.
+	 */
+	if (!ipc_data_receive(&callid, NULL, &size)) {
+		ipc_answer_0(callid, EINVAL);
+		ipc_answer_0(rid, EINVAL);
+		return;
+	}
+
+	/*
+	 * Check whether size is reasonable wrt. the mount point.
+	 */
+	if (size < 1 || size > MAX_PATH_LEN) {
+		ipc_answer_0(callid, EINVAL);
+		ipc_answer_0(rid, EINVAL);
+		return;
+	}
+	/*
+	 * Allocate buffer for the mount point data being received.
 	 */
 	uint8_t *buf;
@@ -116,22 +149,7 @@
 
 	/*
-	 * Deliver the data.
+	 * Deliver the mount point.
 	 */
 	(void) ipc_data_deliver(callid, buf, size);
-
-	char fs_name[FS_NAME_MAXLEN + 1];
-	memcpy(fs_name, buf, FS_NAME_MAXLEN);
-	fs_name[FS_NAME_MAXLEN] = '\0';
-
-	/*
-	 * Check if we know a file system with the same name as is in fs_name.
-	 * This will also give us its file system handle.
-	 */
-	int fs_handle = fs_name_to_handle(fs_name, true);
-	if (!fs_handle) {
-		free(buf);
-		ipc_answer_0(rid, ENOENT);
-		return;
-	}
 
 	/*
@@ -166,6 +184,5 @@
 		 */
 		futex_down(&unlink_futex);
-		rc = vfs_lookup_internal((char *) (buf + FS_NAME_MAXLEN),
-		    size - FS_NAME_MAXLEN, &mp, NULL);
+		rc = vfs_lookup_internal(buf, size, &mp, NULL);
 		if (rc != EOK) {
 			/*
@@ -198,6 +215,5 @@
 		 * We still don't have the root file system mounted.
 		 */
-		if ((size - FS_NAME_MAXLEN == strlen("/")) &&
-		    (buf[FS_NAME_MAXLEN] == '/')) {
+		if ((size == 1) && (buf[0] == '/')) {
 			/*
 			 * For this simple, but important case, we are done.
