Index: uspace/lib/ext4/libext4_extent.c
===================================================================
--- uspace/lib/ext4/libext4_extent.c	(revision 1d4024cff28c0fdc0475fb4e2761bc2dac0a9394)
+++ uspace/lib/ext4/libext4_extent.c	(revision 49c94a3a0434b4b076957742b535ccde31846e07)
@@ -539,5 +539,5 @@
 	uint32_t fblock = ext4_extent_index_get_leaf(index);
 
-	rc = block_get(&block, inode_ref->fs->device, fblock, BLOCK_FLAGS_NOREAD);
+	rc = block_get(&block, inode_ref->fs->device, fblock, BLOCK_FLAGS_NONE);
 	if (rc != EOK) {
 		EXT4FS_DBG("ERROR get_block");
@@ -581,5 +581,5 @@
 	rc = block_put(block);
 	if (rc != EOK) {
-		EXT4FS_DBG("ERROR put_block");
+		EXT4FS_DBG("ERROR block_put returned \%d", rc);
 		return rc;
 	}
@@ -616,12 +616,12 @@
 
 	// First extent maybe released partially
-	uint32_t first_fblock;
-	first_fblock = ext4_extent_get_start(path_ptr->extent) + iblock_from;
-	first_fblock -= ext4_extent_get_first_block(path_ptr->extent);
+	uint32_t first_iblock = ext4_extent_get_first_block(path_ptr->extent);
+	uint32_t first_fblock = ext4_extent_get_start(path_ptr->extent) + iblock_from - first_iblock;
+
 
 	uint16_t block_count = ext4_extent_get_block_count(path_ptr->extent);
 
-	uint16_t delete_count = block_count - first_fblock +
-			ext4_extent_get_start(path_ptr->extent);
+	uint16_t delete_count = block_count - (
+			ext4_extent_get_start(path_ptr->extent) - first_fblock);
 
 	// Release all blocks
@@ -643,5 +643,4 @@
 	if (block_count == 0) {
 		entries--;
-		ext4_extent_header_set_entries_count(path_ptr->header, entries);
 	}
 
@@ -657,10 +656,11 @@
 
 		entries--;
-		ext4_extent_header_set_entries_count(path_ptr->header, entries);
-
 		tmp_ext++;
 	}
 
-	// If leaf node is empty, the whole tree must be checked and the node will be released
+	ext4_extent_header_set_entries_count(path_ptr->header, entries);
+	path_ptr->block->dirty = true;
+
+	// If leaf node is empty, parent entry must be modified
 	bool remove_parent_record = false;
 
@@ -684,5 +684,5 @@
 				EXT4_EXTENT_FIRST_INDEX(path_ptr->header) + entries;
 
-		// Correct entry because of changes in the previous iteration
+		// Correct entries count because of changes in the previous iteration
 		if (remove_parent_record) {
 			entries--;
@@ -700,5 +700,4 @@
 
 		ext4_extent_header_set_entries_count(path_ptr->header, entries);
-
 		path_ptr->block->dirty = true;
 
