Skip to content

Commit 0e9bb07

Browse files
Lukas Czernergregkh
authored andcommitted
ext4: report real fs size after failed resize
[ Upstream commit 6c73284 ] 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]> Signed-off-by: Sasha Levin <[email protected]>
1 parent d8ef8e9 commit 0e9bb07

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
@@ -2047,6 +2047,10 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)
20472047
free_flex_gd(flex_gd);
20482048
if (resize_inode != NULL)
20492049
iput(resize_inode);
2050-
ext4_msg(sb, KERN_INFO, "resized filesystem to %llu", n_blocks_count);
2050+
if (err)
2051+
ext4_warning(sb, "error (%d) occurred during "
2052+
"file system resize", err);
2053+
ext4_msg(sb, KERN_INFO, "resized filesystem to %llu",
2054+
ext4_blocks_count(es));
20512055
return err;
20522056
}

0 commit comments

Comments
 (0)