Index: uspace/lib/ext4/libext4_balloc.c
===================================================================
--- uspace/lib/ext4/libext4_balloc.c	(revision 2f59112756a7b4e140a34a9de2e2150cdffe0fb1)
+++ uspace/lib/ext4/libext4_balloc.c	(revision ef521d4091b277b23a8ea026424ce4b01e0677d9)
@@ -342,4 +342,5 @@
 	block_t *bitmap_block;
 	uint32_t rel_block_idx = 0;
+	uint32_t free_blocks;
 	uint32_t goal;
 	
@@ -348,9 +349,5 @@
 	if (rc != EOK)
 		return rc;
-	else if (goal == 0) {
-		/* no goal found => partition is full */
-		return ENOMEM;
-	}
-	
+
 	ext4_superblock_t *sb = inode_ref->fs->superblock;
 	
@@ -366,4 +363,11 @@
 	if (rc != EOK)
 		return rc;
+
+	free_blocks =
+	    ext4_block_group_get_free_blocks_count(bg_ref->block_group, sb);
+	if (free_blocks == 0) {
+		/* This group has no free blocks */
+		goto goal_failed;
+	}
 	
 	/* Compute indexes */
@@ -469,4 +473,6 @@
 	}
 
+goal_failed:
+
 	rc = ext4_filesystem_put_block_group_ref(bg_ref);
 	if (rc != EOK)
@@ -484,5 +490,12 @@
 		if (rc != EOK)
 			return rc;
-		
+
+		free_blocks =
+		     ext4_block_group_get_free_blocks_count(bg_ref->block_group, sb);
+		if (free_blocks == 0) {
+			/* This group has no free blocks */
+			goto next_group;
+		}
+
 		/* Load block with bitmap */
 		bitmap_block_addr =
@@ -551,4 +564,5 @@
 		}
 
+next_group:
 		rc = ext4_filesystem_put_block_group_ref(bg_ref);
 		if (rc != EOK)
