提交 e6462869 编写于 作者: J Johann Lombardi 提交者: Theodore Ts'o

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: NJohann Lombardi <johann@sun.com>
Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
上级 5adfee9c
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册