Index: uspace/srv/fs/fat/fat_fat.c
===================================================================
--- uspace/srv/fs/fat/fat_fat.c	(revision cb682eb07450f342db8202b36326ce2d82c4b5fe)
+++ uspace/srv/fs/fat/fat_fat.c	(revision 0ec862da203b9b0c3934013365d787a9b0f09bf5)
@@ -33,5 +33,5 @@
 /**
  * @file	fat_fat.c
- * @brief	Functions that manipulate the file allocation tables.
+ * @brief	Functions that manipulate the File Allocation Tables.
  */
 
@@ -45,4 +45,12 @@
 #include <align.h>
 #include <assert.h>
+#include <futex.h>
+
+/**
+ * The fat_alloc_lock futex protects all copies of the File Allocation Table
+ * during allocation of clusters. The lock does not have to be held durring
+ * deallocation of clusters.
+ */  
+static futex_t fat_alloc_lock = FUTEX_INITIALIZER;
 
 block_t *
@@ -261,4 +269,5 @@
 	 * Search FAT1 for unused clusters.
 	 */
+	futex_down(&fat_alloc_lock);
 	for (b = 0, cl = 0; b < sf; blk++) {
 		blk = block_get(dev_handle, rscnt + b, bps);
@@ -284,4 +293,5 @@
 					*lcl = lifo[0];
 					free(lifo);
+					futex_up(&fat_alloc_lock);
 					return EOK;
 				}
@@ -290,4 +300,5 @@
 		block_put(blk);
 	}
+	futex_up(&fat_alloc_lock);
 
 	/*
