Skip to content

Commit

Permalink
ext4: Fixed inode allocator to correctly track a flex_bg's used_dirs
Browse files Browse the repository at this point in the history
When used_dirs was introduced for the flex_groups struct, it looks
like the accounting was not put into place properly, in some places
manipulating free_inodes rather than used_dirs.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
  • Loading branch information
Eric Sandeen authored and Theodore Ts'o committed Mar 24, 2010
1 parent ba69f9a commit c4caae2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/ext4/ialloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ void ext4_free_inode(handle_t *handle, struct inode *inode)
ext4_group_t f;

f = ext4_flex_group(sbi, block_group);
atomic_dec(&sbi->s_flex_groups[f].free_inodes);
atomic_dec(&sbi->s_flex_groups[f].used_dirs);
}

}
Expand Down Expand Up @@ -773,7 +773,7 @@ static int ext4_claim_inode(struct super_block *sb,
if (sbi->s_log_groups_per_flex) {
ext4_group_t f = ext4_flex_group(sbi, group);

atomic_inc(&sbi->s_flex_groups[f].free_inodes);
atomic_inc(&sbi->s_flex_groups[f].used_dirs);
}
}
gdp->bg_checksum = ext4_group_desc_csum(sbi, group, gdp);
Expand Down

0 comments on commit c4caae2

Please sign in to comment.