Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6462869 authored by Johann Lombardi's avatar Johann Lombardi Committed by Theodore Ts'o
Browse files

ext4: Fix goal inum check in the inode allocator



The goal inode is specificed by inode number which belongs
to [1; s_inodes_count].

Signed-off-by: default avatarJohann Lombardi <johann@sun.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 5adfee9c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;