Index: uspace/lib/ext4/libext4_balloc.c
===================================================================
--- uspace/lib/ext4/libext4_balloc.c	(revision 6f413125cdf3989b155ab364f234251b7bc4f125)
+++ uspace/lib/ext4/libext4_balloc.c	(revision 95947d2404b7f09c539e4ebf0b729cc9eaff9fa9)
@@ -143,5 +143,4 @@
 	if (rc != EOK) {
 		EXT4FS_DBG("error in saving bg_ref \%d", rc);
-		// TODO error
 		return rc;
 	}
@@ -221,5 +220,4 @@
 	if (rc != EOK) {
 		EXT4FS_DBG("error in saving bg_ref \%d", rc);
-		// TODO error
 		return rc;
 	}
@@ -275,12 +273,16 @@
 
 	if (inode_block_count > 0) {
-		// TODO check retval
-		ext4_filesystem_get_inode_data_block_index(inode_ref, inode_block_count - 1, &goal);
-
-		// TODO
-		// If goal == 0 -> SPARSE file !!!
-
-		goal++;
-		return goal;
+
+		rc = ext4_filesystem_get_inode_data_block_index(inode_ref, inode_block_count - 1, &goal);
+		if (rc != EOK) {
+			return 0;
+		}
+
+		if (goal != 0) {
+			goal++;
+			return goal;
+		}
+
+		// if goal == 0, sparse file -> continue
 	}
 
@@ -338,5 +340,5 @@
 	uint32_t goal = ext4_balloc_find_goal(inode_ref);
 	if (goal == 0) {
-		// TODO
+		// no goal found => partition is full
 		EXT4FS_DBG("ERRORR (goal == 0)");
 		return ENOSPC;
@@ -385,6 +387,5 @@
 		rc = block_put(bitmap_block);
 		if (rc != EOK) {
-			// TODO error
-			EXT4FS_DBG("goal check: error in saving initial bitmap \%d", rc);
+			EXT4FS_DBG("goal check: error in saving bitmap \%d", rc);
 			ext4_filesystem_put_block_group_ref(bg_ref);
 			return rc;
@@ -411,6 +412,6 @@
 			rc = block_put(bitmap_block);
 			if (rc != EOK) {
-				// TODO error
 				EXT4FS_DBG("near blocks: error in saving initial bitmap \%d", rc);
+				return rc;
 			}
 
@@ -429,6 +430,6 @@
 		rc = block_put(bitmap_block);
 		if (rc != EOK) {
-			// TODO error
 			EXT4FS_DBG("free byte: error in saving initial bitmap \%d", rc);
+			return rc;
 		}
 
@@ -445,6 +446,6 @@
 		rc = block_put(bitmap_block);
 		if (rc != EOK) {
-			// TODO error
 			EXT4FS_DBG("free bit: error in saving initial bitmap \%d", rc);
+			return rc;
 		}
 
@@ -468,5 +469,5 @@
 		rc = ext4_filesystem_get_block_group_ref(inode_ref->fs, bgid, &bg_ref);
 		if (rc != EOK) {
-			EXT4FS_DBG("errrrrrrrrrrr");
+			EXT4FS_DBG("ERROR: unable to load block group \%u", bgid);
 			return rc;
 		}
@@ -479,5 +480,5 @@
 		if (rc != EOK) {
 			ext4_filesystem_put_block_group_ref(bg_ref);
-			EXT4FS_DBG("errrrrrrrrrr");
+			EXT4FS_DBG("ERROR: unable to load bitmap block");
 			return rc;
 		}
@@ -502,6 +503,6 @@
 			rc = block_put(bitmap_block);
 			if (rc != EOK) {
-				// TODO error
-				EXT4FS_DBG("error in saving bitmap \%d", rc);
+				EXT4FS_DBG("ERROR: unable to save bitmap block");
+				return rc;
 			}
 
@@ -518,6 +519,6 @@
 			rc = block_put(bitmap_block);
 			if (rc != EOK) {
-				// TODO error
-				EXT4FS_DBG("error in saving bitmap \%d", rc);
+				EXT4FS_DBG("ERROR: unable to save bitmap block");
+				return rc;
 			}
 
