]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-6.6/ext4-add-a-hint-for-block-bitmap-corrupt-state-in-mb.patch
Linux 6.1.86
[thirdparty/kernel/stable-queue.git] / queue-6.6 / ext4-add-a-hint-for-block-bitmap-corrupt-state-in-mb.patch
1 From 1480a141920fa4b932ddbdea51e01f0b47b0c367 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 257b70c5ded45..a8a3ea2fd690f 100644
28 --- a/fs/ext4/mballoc.c
29 +++ b/fs/ext4/mballoc.c
30 @@ -3060,7 +3060,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