diff options
author | Yu Jian <yujian@whamcloud.com> | 2011-08-01 17:41:39 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-08-01 17:41:39 -0400 |
commit | 48e6061bf4bb25eec151b91f22fd90a5b9a4920a (patch) | |
tree | b0515505a3eee15adcc38325d309553e57e40975 /fs/ext4 | |
parent | 9d8b9ec44234b2f6e0225300632d250210c04f11 (diff) |
ext4: use EXT4_BAD_INO for buddy cache to avoid colliding with valid inode #
Signed-off-by: Yu Jian <yujian@whamcloud.com>
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/mballoc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 70d1b3e64284..e41620b56e53 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
@@ -2342,7 +2342,11 @@ static int ext4_mb_init_backend(struct super_block *sb) | |||
2342 | ext4_msg(sb, KERN_ERR, "can't get new inode"); | 2342 | ext4_msg(sb, KERN_ERR, "can't get new inode"); |
2343 | goto err_freesgi; | 2343 | goto err_freesgi; |
2344 | } | 2344 | } |
2345 | sbi->s_buddy_cache->i_ino = get_next_ino(); | 2345 | /* To avoid potentially colliding with an valid on-disk inode number, |
2346 | * use EXT4_BAD_INO for the buddy cache inode number. This inode is | ||
2347 | * not in the inode hash, so it should never be found by iget(), but | ||
2348 | * this will avoid confusion if it ever shows up during debugging. */ | ||
2349 | sbi->s_buddy_cache->i_ino = EXT4_BAD_INO; | ||
2346 | EXT4_I(sbi->s_buddy_cache)->i_disksize = 0; | 2350 | EXT4_I(sbi->s_buddy_cache)->i_disksize = 0; |
2347 | for (i = 0; i < ngroups; i++) { | 2351 | for (i = 0; i < ngroups; i++) { |
2348 | desc = ext4_get_group_desc(sb, i, NULL); | 2352 | desc = ext4_get_group_desc(sb, i, NULL); |