Skip to content

Commit 6c73284

Browse files
Lukas Czernertytso
authored andcommitted
ext4: report real fs size after failed resize
Currently when the file system resize using ext4_resize_fs() fails it will report into log that "resized filesystem to <requested block count>". However this may not be true in the case of failure. Use the current block count as returned by ext4_blocks_count() to report the block count. Additionally, report a warning that "error occurred during file system resize" Signed-off-by: Lukas Czerner <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]>
1 parent d64264d commit 6c73284

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fs/ext4/resize.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2080,6 +2080,10 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)
20802080
free_flex_gd(flex_gd);
20812081
if (resize_inode != NULL)
20822082
iput(resize_inode);
2083-
ext4_msg(sb, KERN_INFO, "resized filesystem to %llu", n_blocks_count);
2083+
if (err)
2084+
ext4_warning(sb, "error (%d) occurred during "
2085+
"file system resize", err);
2086+
ext4_msg(sb, KERN_INFO, "resized filesystem to %llu",
2087+
ext4_blocks_count(es));
20842088
return err;
20852089
}

0 commit comments

Comments
 (0)