diff options
author | Theodore Ts'o <tytso@mit.edu> | 2013-01-13 08:41:45 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-01-13 08:41:45 -0500 |
commit | 7f5118629f74b82bd4ba5e47415d1b4dcb940241 (patch) | |
tree | 274a76ed1ddd6c19de793c762d04f6f1b6fc4da0 /fs/ext4/super.c | |
parent | 15b49132fc972c63894592f218ea5a9a61b1a18f (diff) |
ext4: trigger the lazy inode table initialization after resize
After we have finished extending the file system, we need to trigger a
the lazy inode table thread to zero out the inode tables.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 3d4fb81bacd5..c014edd12648 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -2776,7 +2776,7 @@ static int ext4_run_li_request(struct ext4_li_request *elr) | |||
2776 | break; | 2776 | break; |
2777 | } | 2777 | } |
2778 | 2778 | ||
2779 | if (group == ngroups) | 2779 | if (group >= ngroups) |
2780 | ret = 1; | 2780 | ret = 1; |
2781 | 2781 | ||
2782 | if (!ret) { | 2782 | if (!ret) { |
@@ -3016,33 +3016,34 @@ static struct ext4_li_request *ext4_li_request_new(struct super_block *sb, | |||
3016 | return elr; | 3016 | return elr; |
3017 | } | 3017 | } |
3018 | 3018 | ||
3019 | static int ext4_register_li_request(struct super_block *sb, | 3019 | int ext4_register_li_request(struct super_block *sb, |
3020 | ext4_group_t first_not_zeroed) | 3020 | ext4_group_t first_not_zeroed) |
3021 | { | 3021 | { |
3022 | struct ext4_sb_info *sbi = EXT4_SB(sb); | 3022 | struct ext4_sb_info *sbi = EXT4_SB(sb); |
3023 | struct ext4_li_request *elr; | 3023 | struct ext4_li_request *elr = NULL; |
3024 | ext4_group_t ngroups = EXT4_SB(sb)->s_groups_count; | 3024 | ext4_group_t ngroups = EXT4_SB(sb)->s_groups_count; |
3025 | int ret = 0; | 3025 | int ret = 0; |
3026 | 3026 | ||
3027 | mutex_lock(&ext4_li_mtx); | ||
3027 | if (sbi->s_li_request != NULL) { | 3028 | if (sbi->s_li_request != NULL) { |
3028 | /* | 3029 | /* |
3029 | * Reset timeout so it can be computed again, because | 3030 | * Reset timeout so it can be computed again, because |
3030 | * s_li_wait_mult might have changed. | 3031 | * s_li_wait_mult might have changed. |
3031 | */ | 3032 | */ |
3032 | sbi->s_li_request->lr_timeout = 0; | 3033 | sbi->s_li_request->lr_timeout = 0; |
3033 | return 0; | 3034 | goto out; |
3034 | } | 3035 | } |
3035 | 3036 | ||
3036 | if (first_not_zeroed == ngroups || | 3037 | if (first_not_zeroed == ngroups || |
3037 | (sb->s_flags & MS_RDONLY) || | 3038 | (sb->s_flags & MS_RDONLY) || |
3038 | !test_opt(sb, INIT_INODE_TABLE)) | 3039 | !test_opt(sb, INIT_INODE_TABLE)) |
3039 | return 0; | 3040 | goto out; |
3040 | 3041 | ||
3041 | elr = ext4_li_request_new(sb, first_not_zeroed); | 3042 | elr = ext4_li_request_new(sb, first_not_zeroed); |
3042 | if (!elr) | 3043 | if (!elr) { |
3043 | return -ENOMEM; | 3044 | ret = -ENOMEM; |
3044 | 3045 | goto out; | |
3045 | mutex_lock(&ext4_li_mtx); | 3046 | } |
3046 | 3047 | ||
3047 | if (NULL == ext4_li_info) { | 3048 | if (NULL == ext4_li_info) { |
3048 | ret = ext4_li_info_new(); | 3049 | ret = ext4_li_info_new(); |