Index: uspace/srv/fs/tmpfs/tmpfs_ops.c
===================================================================
--- uspace/srv/fs/tmpfs/tmpfs_ops.c	(revision 752ccee70526f37f204304e646f75b26bdfe2b07)
+++ uspace/srv/fs/tmpfs/tmpfs_ops.c	(revision 7fff5eab4db78f93413ceae2f73966e318e1a0aa)
@@ -275,5 +275,6 @@
 	}
 
-	ipc_answer_3(rid, EOK, tmpfs_reg.fs_handle, dev_handle, dcur->index);
+	ipc_answer_4(rid, EOK, tmpfs_reg.fs_handle, dev_handle, dcur->index,
+	    dcur->size);
 }
 
@@ -373,5 +374,5 @@
 	dentry->data = newdata;
 	(void) ipc_data_write_finalize(callid, dentry->data + pos, len);
-	ipc_answer_1(rid, EOK, len);
+	ipc_answer_2(rid, EOK, len, dentry->size);
 }
 
Index: uspace/srv/vfs/vfs.h
===================================================================
--- uspace/srv/vfs/vfs.h	(revision 752ccee70526f37f204304e646f75b26bdfe2b07)
+++ uspace/srv/vfs/vfs.h	(revision 7fff5eab4db78f93413ceae2f73966e318e1a0aa)
@@ -188,8 +188,9 @@
 extern int fs_name_to_handle(char *, bool);
 
-extern int vfs_lookup_internal(char *, size_t, vfs_triplet_t *, vfs_pair_t *);
+extern int vfs_lookup_internal(char *, size_t, vfs_triplet_t *, size_t *,
+    vfs_pair_t *);
 
 extern bool vfs_nodes_init(void);
-extern vfs_node_t *vfs_node_get(vfs_triplet_t *);
+extern vfs_node_t *vfs_node_get(vfs_triplet_t *, size_t);
 extern void vfs_node_put(vfs_node_t *);
 
Index: uspace/srv/vfs/vfs_lookup.c
===================================================================
--- uspace/srv/vfs/vfs_lookup.c	(revision 752ccee70526f37f204304e646f75b26bdfe2b07)
+++ uspace/srv/vfs/vfs_lookup.c	(revision 7fff5eab4db78f93413ceae2f73966e318e1a0aa)
@@ -57,4 +57,6 @@
  * @param len		Number of path characters pointed by path.
  * @param result	Empty node structure where the result will be stored.
+ * @param size		Storage where the size of the node will be stored. Can
+ *			be NULL.
  * @param altroot	If non-empty, will be used instead of rootfs as the root
  *			of the whole VFS tree.
@@ -63,5 +65,5 @@
  */
 int vfs_lookup_internal(char *path, size_t len, vfs_triplet_t *result,
-    vfs_pair_t *altroot)
+    size_t *size, vfs_pair_t *altroot)
 {
 	vfs_pair_t *root;
@@ -166,4 +168,6 @@
 		result->dev_handle = (int) IPC_GET_ARG2(answer);
 		result->index = (int) IPC_GET_ARG3(answer);
+		if (size)
+			*size = (size_t) IPC_GET_ARG4(answer);
 	}
 
Index: uspace/srv/vfs/vfs_mount.c
===================================================================
--- uspace/srv/vfs/vfs_mount.c	(revision 752ccee70526f37f204304e646f75b26bdfe2b07)
+++ uspace/srv/vfs/vfs_mount.c	(revision 7fff5eab4db78f93413ceae2f73966e318e1a0aa)
@@ -53,5 +53,6 @@
 };
 
-static int lookup_root(int fs_handle, int dev_handle, vfs_triplet_t *root)
+static int lookup_root(int fs_handle, int dev_handle, vfs_triplet_t *root,
+    size_t *size)
 {
 	vfs_pair_t altroot = {
@@ -60,5 +61,5 @@
 	};
 
-	return vfs_lookup_internal("/", strlen("/"), root, &altroot);
+	return vfs_lookup_internal("/", strlen("/"), root, size, &altroot);
 }
 
@@ -161,5 +162,6 @@
 	int rc;
 	vfs_triplet_t mounted_root;
-	rc = lookup_root(fs_handle, dev_handle, &mounted_root);
+	size_t mrsz;
+	rc = lookup_root(fs_handle, dev_handle, &mounted_root, &mrsz);
 	if (rc != EOK) {
 		free(buf);
@@ -167,5 +169,5 @@
 		return;
 	}
-	vfs_node_t *mr_node = vfs_node_get(&mounted_root);
+	vfs_node_t *mr_node = vfs_node_get(&mounted_root, mrsz);
 	if (!mr_node) {
 		free(buf);
@@ -178,4 +180,5 @@
 	 */
 	vfs_triplet_t mp;
+	size_t mpsz;
 	futex_down(&rootfs_futex);
 	if (rootfs.fs_handle) {
@@ -184,5 +187,5 @@
 		 */
 		rwlock_writer_lock(&namespace_rwlock);
-		rc = vfs_lookup_internal(buf, size, &mp, NULL);
+		rc = vfs_lookup_internal(buf, size, &mp, &mpsz, NULL);
 		if (rc != EOK) {
 			/*
@@ -196,5 +199,5 @@
 			return;
 		}
-		mp_node = vfs_node_get(&mp);
+		mp_node = vfs_node_get(&mp, mpsz);
 		if (!mp_node) {
 			rwlock_writer_unlock(&namespace_rwlock);
Index: uspace/srv/vfs/vfs_node.c
===================================================================
--- uspace/srv/vfs/vfs_node.c	(revision 752ccee70526f37f204304e646f75b26bdfe2b07)
+++ uspace/srv/vfs/vfs_node.c	(revision 7fff5eab4db78f93413ceae2f73966e318e1a0aa)
@@ -43,4 +43,5 @@
 #include <rwlock.h>
 #include <libadt/hash_table.h>
+#include <assert.h>
 
 /** Futex protecting the VFS node hash table. */
@@ -122,8 +123,9 @@
  *
  * @param triplet	Triplet encoding the identity of the VFS node.
+ * @param size		Size of the node as filled by vfs_lookup_internal().
  *
  * @return		VFS node corresponding to the given triplet.
  */
-vfs_node_t *vfs_node_get(vfs_triplet_t *triplet)
+vfs_node_t *vfs_node_get(vfs_triplet_t *triplet, size_t size)
 {
 	unsigned long key[] = {
@@ -147,4 +149,5 @@
 		node->dev_handle = triplet->fs_handle;
 		node->index = triplet->index;
+		node->size = size;
 		link_initialize(&node->nh_link);
 		rwlock_initialize(&node->contents_rwlock);
@@ -153,4 +156,7 @@
 		node = hash_table_get_instance(tmp, vfs_node_t, nh_link);	
 	}
+
+	assert(node->size == size);
+
 	_vfs_node_addref(node);
 	futex_up(&nodes_futex);
Index: uspace/srv/vfs/vfs_open.c
===================================================================
--- uspace/srv/vfs/vfs_open.c	(revision 752ccee70526f37f204304e646f75b26bdfe2b07)
+++ uspace/srv/vfs/vfs_open.c	(revision 7fff5eab4db78f93413ceae2f73966e318e1a0aa)
@@ -58,9 +58,9 @@
 	int flags = IPC_GET_ARG1(*request);
 	int mode = IPC_GET_ARG2(*request);
-	size_t size;
+	size_t len;
 
 	ipc_callid_t callid;
 
-	if (!ipc_data_write_receive(&callid, &size)) {
+	if (!ipc_data_write_receive(&callid, &len)) {
 		ipc_answer_0(callid, EINVAL);
 		ipc_answer_0(rid, EINVAL);
@@ -74,5 +74,5 @@
 	 * directly into the PLB using some kind of a callback.
 	 */
-	char *path = malloc(size);
+	char *path = malloc(len);
 	
 	if (!path) {
@@ -83,5 +83,5 @@
 
 	int rc;
-	if ((rc = ipc_data_write_finalize(callid, path, size))) {
+	if ((rc = ipc_data_write_finalize(callid, path, len))) {
 		ipc_answer_0(rid, rc);
 		free(path);
@@ -100,5 +100,6 @@
 	 */
 	vfs_triplet_t triplet;
-	rc = vfs_lookup_internal(path, size, &triplet, NULL);
+	size_t size;
+	rc = vfs_lookup_internal(path, len, &triplet, &size, NULL);
 	if (rc) {
 		rwlock_reader_unlock(&namespace_rwlock);
@@ -113,5 +114,5 @@
 	free(path);
 
-	vfs_node_t *node = vfs_node_get(&triplet);
+	vfs_node_t *node = vfs_node_get(&triplet, size);
 	rwlock_reader_unlock(&namespace_rwlock);
 
Index: uspace/srv/vfs/vfs_rdwr.c
===================================================================
--- uspace/srv/vfs/vfs_rdwr.c	(revision 752ccee70526f37f204304e646f75b26bdfe2b07)
+++ uspace/srv/vfs/vfs_rdwr.c	(revision 7fff5eab4db78f93413ceae2f73966e318e1a0aa)
@@ -130,6 +130,9 @@
 	if (read)
 		rwlock_reader_unlock(&file->node->contents_rwlock);
-	else
+	else {
+		/* Update the cached version of node's size. */
+		file->node->size = IPC_GET_ARG2(answer); 
 		rwlock_writer_unlock(&file->node->contents_rwlock);
+	}
 
 	/*
