]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/6.8.6/ext4-add-a-hint-for-block-bitmap-corrupt-state-in-mb.patch
Linux 6.8.6
[thirdparty/kernel/stable-queue.git] / releases / 6.8.6 / ext4-add-a-hint-for-block-bitmap-corrupt-state-in-mb.patch
CommitLineData
335f7cc0
SL
1From 510da82c2040906537db1fb7a7bd9215be81fbf6 Mon Sep 17 00:00:00 2001
2From: Sasha Levin <sashal@kernel.org>
3Date: Fri, 19 Jan 2024 14:11:54 +0800
4Subject: ext4: add a hint for block bitmap corrupt state in mb_groups
5
6From: Zhang Yi <yi.zhang@huawei.com>
7
8[ Upstream commit 68ee261fb15457ecb17e3683cb4e6a4792ca5b71 ]
9
10If one group is marked as block bitmap corrupted, its free blocks cannot
11be used and its free count is also deducted from the global
12sbi->s_freeclusters_counter. User might be confused about the absent
13free space because we can't query the information about corrupted block
14groups except unreliable error messages in syslog. So add a hint to show
15block bitmap corrupted groups in mb_groups.
16
17Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
18Reviewed-by: Jan Kara <jack@suse.cz>
19Link: https://lore.kernel.org/r/20240119061154.1525781-1-yi.zhang@huaweicloud.com
20Signed-off-by: Theodore Ts'o <tytso@mit.edu>
21Signed-off-by: Sasha Levin <sashal@kernel.org>
22---
23 fs/ext4/mballoc.c | 5 ++++-
24 1 file changed, 4 insertions(+), 1 deletion(-)
25
26diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
27index 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--
432.43.0
44