Skip to content

Commit 4da4a56

Browse files
committed
ext4: log a resize update to the console every 10 seconds
For very long online resizes, a periodic update to the console log is helpful for debugging and for progress reporting. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
1 parent 1c6bd71 commit 4da4a56

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎fs/ext4/resize.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,6 +1869,7 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)
18691869
ext4_group_t n_group;
18701870
ext4_fsblk_t o_blocks_count;
18711871
ext4_fsblk_t n_blocks_count_retry = 0;
1872+
unsigned long last_update_time = 0;
18721873
int err = 0, flexbg_size = 1 << sbi->s_log_groups_per_flex;
18731874
int meta_bg;
18741875

@@ -1977,6 +1978,13 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)
19771978
*/
19781979
while (ext4_setup_next_flex_gd(sb, flex_gd, n_blocks_count,
19791980
flexbg_size)) {
1981+
if (jiffies - last_update_time > HZ * 10) {
1982+
if (last_update_time)
1983+
ext4_msg(sb, KERN_INFO,
1984+
"resized to %llu blocks",
1985+
ext4_blocks_count(es));
1986+
last_update_time = jiffies;
1987+
}
19801988
if (ext4_alloc_group_tables(sb, flex_gd, flexbg_size) != 0)
19811989
break;
19821990
err = ext4_flex_group_add(sb, resize_inode, flex_gd);

0 commit comments

Comments
 (0)