Index: uspace/srv/fs/exfat/exfat_fat.c
===================================================================
--- uspace/srv/fs/exfat/exfat_fat.c	(revision 93e12f39d4e270767124977a59605edf2784b647)
+++ uspace/srv/fs/exfat/exfat_fat.c	(revision a9b756e22f473424c72d34adee42971bbaa0a107)
@@ -38,4 +38,5 @@
 
 #include "exfat_fat.h"
+#include "exfat_bitmap.h"
 #include "exfat.h"
 #include "../../vfs/vfs.h"
@@ -301,5 +302,5 @@
 	exfat_cluster_t *lifo;    /* stack for storing free cluster numbers */
 	unsigned found = 0;     /* top of the free cluster number stack */
-	exfat_cluster_t clst, value;
+	exfat_cluster_t clst;
 	int rc = EOK;
 
@@ -310,9 +311,6 @@
 	fibril_mutex_lock(&exfat_alloc_lock);
 	for (clst=EXFAT_CLST_FIRST; clst < DATA_CNT(bs)+2 && found < nclsts; clst++) {
-		rc = exfat_get_cluster(bs, devmap_handle, clst, &value);
-		if (rc != EOK)
-			break;
-
-		if (value == 0) {
+		/* Need to rewrite because of multiple exfat_bitmap_get calls */
+		if (bitmap_is_free(bs, devmap_handle, clst)==EOK) {
 		   /*
 			* The cluster is free. Put it into our stack
@@ -324,6 +322,9 @@
 			if (rc != EOK)
 				break;
-
 			found++;
+			rc = bitmap_set_cluster(bs, devmap_handle, clst);
+			if (rc != EOK)
+				break;
+
 		}
 	}
@@ -339,6 +340,8 @@
 	/* If something wrong - free the clusters */
 	if (found > 0) {
-		while (found--)
-			rc = exfat_set_cluster(bs, devmap_handle, lifo[found], 0);
+		while (found--) {
+			(void) bitmap_clear_cluster(bs, devmap_handle, lifo[found]);
+			(void) exfat_set_cluster(bs, devmap_handle, lifo[found], 0);
+		}
 	}
 
