Index: uspace/srv/fs/fat/fat_ops.c
===================================================================
--- uspace/srv/fs/fat/fat_ops.c	(revision f14291b7aa81b1c2e34c39b70fe6df96dec062b6)
+++ uspace/srv/fs/fat/fat_ops.c	(revision a93d79a46693b2c1d9a1d42413c586c2049c4ef1)
@@ -369,16 +369,18 @@
 	unsigned blocks;
 	fat_dentry_t *d;
+	dev_handle_t dev_handle;
 	block_t *b;
 	int rc;
 
 	fibril_mutex_lock(&parentp->idx->lock);
-	bs = block_bb_get(parentp->idx->dev_handle);
+	dev_handle = parentp->idx->dev_handle;
+	fibril_mutex_unlock(&parentp->idx->lock);
+
+	bs = block_bb_get(dev_handle);
 	blocks = parentp->size / BPS(bs);
 	for (i = 0; i < blocks; i++) {
 		rc = fat_block_get(&b, bs, parentp, i, BLOCK_FLAGS_NONE);
-		if (rc != EOK) {
-			fibril_mutex_unlock(&parentp->idx->lock);
+		if (rc != EOK)
 			return rc;
-		}
 		for (j = 0; j < DPS(bs); j++) { 
 			d = ((fat_dentry_t *)b->data) + j;
@@ -390,5 +392,4 @@
 				/* miss */
 				rc = block_put(b);
-				fibril_mutex_unlock(&parentp->idx->lock);
 				*rfn = NULL;
 				return rc;
@@ -401,14 +402,6 @@
 				/* hit */
 				fat_node_t *nodep;
-				/*
-				 * Assume tree hierarchy for locking.  We
-				 * already have the parent and now we are going
-				 * to lock the child.  Never lock in the oposite
-				 * order.
-				 */
-				fat_idx_t *idx = fat_idx_get_by_pos(
-				    parentp->idx->dev_handle, parentp->firstc,
-				    i * DPS(bs) + j);
-				fibril_mutex_unlock(&parentp->idx->lock);
+				fat_idx_t *idx = fat_idx_get_by_pos(dev_handle,
+				    parentp->firstc, i * DPS(bs) + j);
 				if (!idx) {
 					/*
@@ -433,11 +426,8 @@
 		}
 		rc = block_put(b);
-		if (rc != EOK) {
-			fibril_mutex_unlock(&parentp->idx->lock);
+		if (rc != EOK)
 			return rc;
-		}
-	}
-
-	fibril_mutex_unlock(&parentp->idx->lock);
+	}
+
 	*rfn = NULL;
 	return EOK;
