]>
Commit | Line | Data |
---|---|---|
1 | From 510da82c2040906537db1fb7a7bd9215be81fbf6 Mon Sep 17 00:00:00 2001 | |
2 | From: Sasha Levin <sashal@kernel.org> | |
3 | Date: Fri, 19 Jan 2024 14:11:54 +0800 | |
4 | Subject: ext4: add a hint for block bitmap corrupt state in mb_groups | |
5 | ||
6 | From: Zhang Yi <yi.zhang@huawei.com> | |
7 | ||
8 | [ Upstream commit 68ee261fb15457ecb17e3683cb4e6a4792ca5b71 ] | |
9 | ||
10 | If one group is marked as block bitmap corrupted, its free blocks cannot | |
11 | be used and its free count is also deducted from the global | |
12 | sbi->s_freeclusters_counter. User might be confused about the absent | |
13 | free space because we can't query the information about corrupted block | |
14 | groups except unreliable error messages in syslog. So add a hint to show | |
15 | block bitmap corrupted groups in mb_groups. | |
16 | ||
17 | Signed-off-by: Zhang Yi <yi.zhang@huawei.com> | |
18 | Reviewed-by: Jan Kara <jack@suse.cz> | |
19 | Link: https://lore.kernel.org/r/20240119061154.1525781-1-yi.zhang@huaweicloud.com | |
20 | Signed-off-by: Theodore Ts'o <tytso@mit.edu> | |
21 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
22 | --- | |
23 | fs/ext4/mballoc.c | 5 ++++- | |
24 | 1 file changed, 4 insertions(+), 1 deletion(-) | |
25 | ||
26 | diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c | |
27 | index 70836e25418ab..cf407425d0f30 100644 | |
28 | --- a/fs/ext4/mballoc.c | |
29 | +++ b/fs/ext4/mballoc.c | |
30 | @@ -3059,7 +3059,10 @@ static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v) | |
31 | for (i = 0; i <= 13; i++) | |
32 | seq_printf(seq, " %-5u", i <= blocksize_bits + 1 ? | |
33 | sg.info.bb_counters[i] : 0); | |
34 | - seq_puts(seq, " ]\n"); | |
35 | + seq_puts(seq, " ]"); | |
36 | + if (EXT4_MB_GRP_BBITMAP_CORRUPT(&sg.info)) | |
37 | + seq_puts(seq, " Block bitmap corrupted!"); | |
38 | + seq_puts(seq, "\n"); | |
39 | ||
40 | return 0; | |
41 | } | |
42 | -- | |
43 | 2.43.0 | |
44 |