diff options
author | Baokun Li <libaokun1@huawei.com> | 2024-01-04 15:20:34 +0100 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2024-01-18 16:50:24 +0100 |
commit | 172202152a125955367393956acf5f4ffd092e0d (patch) | |
tree | fc709784b679b406515c7eb949d0e88a005f0542 /fs/ext4 | |
parent | ext4: fix double-free of blocks due to wrong extents moved_len (diff) | |
download | linux-172202152a125955367393956acf5f4ffd092e0d.tar.xz linux-172202152a125955367393956acf5f4ffd092e0d.zip |
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>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/mballoc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index f44f668e407f..c86c90b494de 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -6761,6 +6761,9 @@ __releases(ext4_group_lock_ptr(sb, e4b->bd_group)) bool set_trimmed = false; void *bitmap; + if (unlikely(EXT4_MB_GRP_BBITMAP_CORRUPT(e4b->bd_info))) + return 0; + last = ext4_last_grp_cluster(sb, e4b->bd_group); bitmap = e4b->bd_bitmap; if (start == 0 && max >= last) |