projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
55583e8
)
ext4: do not trim the group with corrupted block bitmap
author
Baokun Li
<libaokun1@huawei.com>
Thu, 4 Jan 2024 14:20:34 +0000
(22:20 +0800)
committer
Theodore Ts'o
<tytso@mit.edu>
Thu, 18 Jan 2024 15:50:24 +0000
(10:50 -0500)
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>
fs/ext4/mballoc.c
patch
|
blob
|
history
diff --git
a/fs/ext4/mballoc.c
b/fs/ext4/mballoc.c
index f44f668e407f2bda9fe325631c9a4ab62649b9dc..c86c90b494de3050935b9da0efdba9d68d5387fe 100644
(file)
--- 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)