Skip to content

Commit 1722021

Browse files
LiBaokun96tytso
authored andcommitted
ext4: do not trim the group with corrupted block bitmap
Otherwise operating on an incorrupted block bitmap can lead to all sorts of unknown problems. Signed-off-by: Baokun Li <libaokun1@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20240104142040.2835097-3-libaokun1@huawei.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent 55583e8 commit 1722021

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/ext4/mballoc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6761,6 +6761,9 @@ __releases(ext4_group_lock_ptr(sb, e4b->bd_group))
67616761
bool set_trimmed = false;
67626762
void *bitmap;
67636763

6764+
if (unlikely(EXT4_MB_GRP_BBITMAP_CORRUPT(e4b->bd_info)))
6765+
return 0;
6766+
67646767
last = ext4_last_grp_cluster(sb, e4b->bd_group);
67656768
bitmap = e4b->bd_bitmap;
67666769
if (start == 0 && max >= last)

0 commit comments

Comments
 (0)