提交 48e6061b 编写于 作者: Y Yu Jian 提交者: Theodore Ts'o

ext4: use EXT4_BAD_INO for buddy cache to avoid colliding with valid inode #

Signed-off-by: NYu Jian <yujian@whamcloud.com>
Signed-off-by: NAndreas Dilger <adilger@whamcloud.com>
Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
上级 9d8b9ec4
......@@ -2342,7 +2342,11 @@ static int ext4_mb_init_backend(struct super_block *sb)
ext4_msg(sb, KERN_ERR, "can't get new inode");
goto err_freesgi;
}
sbi->s_buddy_cache->i_ino = get_next_ino();
/* To avoid potentially colliding with an valid on-disk inode number,
* use EXT4_BAD_INO for the buddy cache inode number. This inode is
* not in the inode hash, so it should never be found by iget(), but
* this will avoid confusion if it ever shows up during debugging. */
sbi->s_buddy_cache->i_ino = EXT4_BAD_INO;
EXT4_I(sbi->s_buddy_cache)->i_disksize = 0;
for (i = 0; i < ngroups; i++) {
desc = ext4_get_group_desc(sb, i, NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册