]>
Commit | Line | Data |
---|---|---|
e4a1bd70 SLM |
1 | From b3ce572831bc8f7063792eceb7005a1c393abe4c Mon Sep 17 00:00:00 2001 |
2 | From: Lukas Czerner <lczerner@redhat.com> | |
3 | Date: Fri, 15 Mar 2019 00:22:28 -0400 | |
4 | Subject: ext4: report real fs size after failed resize | |
5 | ||
6 | [ Upstream commit 6c7328400e0488f7d49e19e02290ba343b6811b2 ] | |
7 | ||
8 | Currently when the file system resize using ext4_resize_fs() fails it | |
9 | will report into log that "resized filesystem to <requested block | |
10 | count>". However this may not be true in the case of failure. Use the | |
11 | current block count as returned by ext4_blocks_count() to report the | |
12 | block count. | |
13 | ||
14 | Additionally, report a warning that "error occurred during file system | |
15 | resize" | |
16 | ||
17 | Signed-off-by: Lukas Czerner <lczerner@redhat.com> | |
18 | Signed-off-by: Theodore Ts'o <tytso@mit.edu> | |
19 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
20 | --- | |
21 | fs/ext4/resize.c | 6 +++++- | |
22 | 1 file changed, 5 insertions(+), 1 deletion(-) | |
23 | ||
24 | diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c | |
25 | index 90061c3d048b..e7ae26e36c9c 100644 | |
26 | --- a/fs/ext4/resize.c | |
27 | +++ b/fs/ext4/resize.c | |
28 | @@ -2080,6 +2080,10 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count) | |
29 | free_flex_gd(flex_gd); | |
30 | if (resize_inode != NULL) | |
31 | iput(resize_inode); | |
32 | - ext4_msg(sb, KERN_INFO, "resized filesystem to %llu", n_blocks_count); | |
33 | + if (err) | |
34 | + ext4_warning(sb, "error (%d) occurred during " | |
35 | + "file system resize", err); | |
36 | + ext4_msg(sb, KERN_INFO, "resized filesystem to %llu", | |
37 | + ext4_blocks_count(es)); | |
38 | return err; | |
39 | } | |
40 | -- | |
41 | 2.19.1 | |
42 |