mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
ext4: do not trim the group with corrupted block bitmap
[ Upstream commit 172202152a125955367393956acf5f4ffd092e0d ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
01136f8721
commit
d7b57fbfa1
@@ -6483,6 +6483,9 @@ __releases(ext4_group_lock_ptr(sb, e4b->bd_group))
|
|||||||
bool set_trimmed = false;
|
bool set_trimmed = false;
|
||||||
void *bitmap;
|
void *bitmap;
|
||||||
|
|
||||||
|
if (unlikely(EXT4_MB_GRP_BBITMAP_CORRUPT(e4b->bd_info)))
|
||||||
|
return 0;
|
||||||
|
|
||||||
last = ext4_last_grp_cluster(sb, e4b->bd_group);
|
last = ext4_last_grp_cluster(sb, e4b->bd_group);
|
||||||
bitmap = e4b->bd_bitmap;
|
bitmap = e4b->bd_bitmap;
|
||||||
if (start == 0 && max >= last)
|
if (start == 0 && max >= last)
|
||||||
|
|||||||
Reference in New Issue
Block a user