Browse Source

FIX: wrong accounting caused by EXT2_BG_INODE_ZEROED

pull/11/head
ngkaho1234 9 years ago
parent
commit
7620882400
  1. 6
      lwext4/ext4_ialloc.c

6
lwext4/ext4_ialloc.c

@ -285,14 +285,9 @@ int ext4_ialloc_alloc_inode(struct ext4_fs *fs, uint32_t *index, bool is_dir)
}
/* 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 inodes_in_group =
ext4_inodes_in_group_cnt(sb, bgid);
uint32_t free = inodes_in_group - unused;
if (index_in_group >= free) {
@ -301,7 +296,6 @@ int ext4_ialloc_alloc_inode(struct ext4_fs *fs, uint32_t *index, bool is_dir)
ext4_bg_set_itable_unused(bg, sb,
unused);
}
}
/* Save modified block group */
bg_ref.dirty = true;

Loading…
Cancel
Save