shithub: lwext4

Download patch

ref: 76208824002dca9dffab5ee03fe66239ad4493b3
parent: b5b25a0e9d3ffaa663e3a94540442f19d8df1883
author: ngkaho1234 <[email protected]>
date: Tue Oct 27 16:49:44 EDT 2015

FIX: wrong accounting caused by EXT2_BG_INODE_ZEROED

--- a/lwext4/ext4_ialloc.c
+++ b/lwext4/ext4_ialloc.c
@@ -285,22 +285,16 @@
 			}
 
 			/* Decrease unused inodes count */
-			if (ext4_bg_has_flag(bg,
-					     EXT4_BLOCK_GROUP_ITABLE_ZEROED)) {
-				uint32_t unused =
-				    ext4_bg_get_itable_unused(bg, sb);
+			uint32_t unused =
+			    ext4_bg_get_itable_unused(bg, sb);
 
-				uint32_t inodes_in_group =
-				    ext4_inodes_in_group_cnt(sb, bgid);
+			uint32_t free = inodes_in_group - unused;
 
-				uint32_t free = inodes_in_group - unused;
-
-				if (index_in_group >= free) {
-					unused = inodes_in_group -
-						 (index_in_group + 1);
-					ext4_bg_set_itable_unused(bg, sb,
-								  unused);
-				}
+			if (index_in_group >= free) {
+				unused = inodes_in_group -
+					 (index_in_group + 1);
+				ext4_bg_set_itable_unused(bg, sb,
+							  unused);
 			}
 
 			/* Save modified block group */