Index: uspace/srv/fs/fat/fat_idx.c
===================================================================
--- uspace/srv/fs/fat/fat_idx.c	(revision 34b3ce3115e73f88ee7c7a1388ff78f9e8ca01cf)
+++ uspace/srv/fs/fat/fat_idx.c	(revision 4452366c55578c3e4f4c43a1da5f4c5e3463d239)
@@ -69,4 +69,8 @@
 } unused_t;
 
+/** Futex protecting the list of unused structures. */
+static futex_t unused_futex = FUTEX_INITIALIZER;
+
+/** List of unused structures. */
 static LIST_INITIALIZE(unused_head);
 
@@ -188,4 +192,5 @@
 	
 	assert(index);
+	futex_down(&unused_futex);
 	for (l = unused_head.next; l != &unused_head; l = l->next) {
 		u = list_get_instance(l, unused_t, link);
@@ -193,5 +198,6 @@
 			goto hit;
 	}
-
+	futex_up(&unused_futex);
+	
 	/* dev_handle not found */
 	return false;	
@@ -206,4 +212,5 @@
 			*index = u->next++;
 			--u->remaining;
+			futex_up(&unused_futex);
 			return true;
 		}
@@ -218,4 +225,5 @@
 			free(f);
 		}
+		futex_up(&unused_futex);
 		return true;
 	}
@@ -225,4 +233,5 @@
 	 * too many zero-sized nodes).
 	 */
+	futex_up(&unused_futex);
 	return false;
 }
@@ -253,4 +262,5 @@
 	unused_t *u;
 
+	futex_down(&unused_futex);
 	for (l = unused_head.next; l != &unused_head; l = l->next) {
 		u = list_get_instance(l, unused_t, link);
@@ -258,4 +268,5 @@
 			goto hit;
 	}
+	futex_up(&unused_futex);
 
 	/* should not happen */
@@ -267,5 +278,4 @@
 		u->next--;
 		u->remaining++;
-		return;
 	} else {
 		/*
@@ -283,4 +293,5 @@
 					try_coalesce_intervals(lnk->prev, lnk,
 					    lnk);
+				futex_up(&unused_futex);
 				return;
 			}
@@ -290,4 +301,5 @@
 					try_coalesce_intervals(lnk, lnk->next,
 					    lnk);
+				futex_up(&unused_futex);
 				return;
 			}
@@ -300,4 +312,5 @@
 				n->last = index;
 				list_insert_before(&n->link, lnk);
+				futex_up(&unused_futex);
 				return;
 			}
@@ -313,4 +326,5 @@
 		list_append(&n->link, &u->freed_head);
 	}
+	futex_up(&unused_futex);
 }
 
