Index: uspace/srv/fs/exfat/exfat_ops.c
===================================================================
--- uspace/srv/fs/exfat/exfat_ops.c	(revision bca3eac9400777b3adb3fc22df40b6b5c73b00a7)
+++ uspace/srv/fs/exfat/exfat_ops.c	(revision 93e12f39d4e270767124977a59605edf2784b647)
@@ -137,4 +137,10 @@
 	exfat_directory_open_parent(&di, node->idx->devmap_handle, node->idx->pfc, 
 	    node->idx->parent_fragmented);
+	rc = exfat_directory_seek(&di, node->idx->pdi);
+	if (rc != EOK) {
+		(void) exfat_directory_close(&di);
+		return rc;
+	}
+
 	rc = exfat_directory_sync_file(&di, &df, &ds);
 	if (rc != EOK) {
@@ -614,6 +620,8 @@
 	exfat_idx_t *idxp;
 	exfat_node_t *nodep;
-	int rc;
-
+	exfat_bs_t *bs;
+	int rc;
+
+	bs = block_bb_get(devmap_handle);
 	rc = exfat_node_get_new(&nodep);
 	if (rc != EOK)
@@ -625,9 +633,4 @@
 		return rc;
 	}
-
-	if (flags & L_DIRECTORY)
-		nodep->type = EXFAT_DIRECTORY;
-	else
-		nodep->type = EXFAT_FILE;
 
 	nodep->firstc = 0;
@@ -640,6 +643,18 @@
 	nodep->idx = idxp;
 	idxp->nodep = nodep;
-
 	fibril_mutex_unlock(&idxp->lock);
+
+	if (flags & L_DIRECTORY) {
+		nodep->type = EXFAT_DIRECTORY;
+		rc = exfat_node_expand(devmap_handle, nodep, 1);
+		if (rc != EOK) {
+			(void) exfat_node_put(FS_NODE(nodep));
+			return rc;
+		}
+		nodep->size = BPC(bs);
+	} else {
+		nodep->type = EXFAT_FILE;
+	}
+
 	*rfn = FS_NODE(nodep);
 	return EOK;
@@ -712,5 +727,4 @@
 	if (rc != EOK)
 		return rc;
-
 	/*
 	 * At this point we only establish the link between the parent and the
@@ -735,5 +749,5 @@
 	childp->idx->pfc = parentp->firstc;
 	childp->idx->parent_fragmented = parentp->fragmented;
-	childp->idx->pdi = di.pos;	/* di.pos holds absolute position of SFN entry */
+	childp->idx->pdi = di.pos;
 	fibril_mutex_unlock(&childp->idx->lock);
 
@@ -932,5 +946,5 @@
 	int i, rc;
 	exfat_cluster_t clst;
-	for (i=0; i<=10; i++) {
+	for (i=0; i<=7; i++) {
 		rc = exfat_get_cluster(bs, devmap_handle, i, &clst);
 		if (rc != EOK)
@@ -1168,23 +1182,4 @@
 	return EOK;
 }
-
-/*
-int bitmap_is_allocated(exfat_bs_t *bs, devmap_handle_t devmap_handle,
-    exfat_cluster_t clst, bool *status)
-{
-	fs_node_t *fn;
-	exfat_node_t *bitmap;
-	int rc;
-
-	rc = exfat_bitmap_get(&fn, devmap_handle);
-	if (rc != EOK)
-		return rc;
-
-	nbitmap = EXFAT_NODE(fn);
-
-	
-	return EOK;
-}
-*/
 
 static int
@@ -1364,5 +1359,4 @@
 
 	boundary = ROUND_UP(nodep->size, BPC(bs));
-
 	if (pos >= boundary) {
 		unsigned nclsts;
