Skip to content

Commit

Permalink
ext4: Fix goal inum check in the inode allocator
Browse files Browse the repository at this point in the history
The goal inode is specificed by inode number which belongs
to [1; s_inodes_count].

Signed-off-by: Johann Lombardi <johann@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
  • Loading branch information
Johann Lombardi authored and Theodore Ts'o committed Jul 6, 2009
1 parent 5adfee9 commit e646286
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ext4/ialloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, int mode,
if (!goal)
goal = sbi->s_inode_goal;

if (goal && goal < le32_to_cpu(sbi->s_es->s_inodes_count)) {
if (goal && goal <= le32_to_cpu(sbi->s_es->s_inodes_count)) {
group = (goal - 1) / EXT4_INODES_PER_GROUP(sb);
ino = (goal - 1) % EXT4_INODES_PER_GROUP(sb);
ret2 = 0;
Expand Down

0 comments on commit e646286

Please sign in to comment.