mirror of
https://gitee.com/openharmony/third_party_f2fs-tools
synced 2024-11-23 10:10:00 +00:00
fsck.f2fs: always fix seg entry type if it is not DATA
If the segment type and sum footer type are node, but its sit type is corrupted as cold data, this will always trigger type error crash in do_garbage_collect but not get fixed by fsck, so fix seg entry type when it is not DATA. Reported-by: KARBOWSKI Piotr <piotr.karbowski@gmail.com> Signed-off-by: Liu Xue <liuxueliu.liu@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
ada65254f6
commit
5d9032fd1b
@ -1843,7 +1843,8 @@ int check_sit_types(struct f2fs_sb_info *sbi)
|
||||
|
||||
se = get_seg_entry(sbi, i);
|
||||
if (se->orig_type != se->type) {
|
||||
if (se->orig_type == CURSEG_COLD_DATA) {
|
||||
if (se->orig_type == CURSEG_COLD_DATA &&
|
||||
se->type <= CURSEG_COLD_DATA) {
|
||||
se->type = se->orig_type;
|
||||
} else {
|
||||
FIX_MSG("Wrong segment type [0x%x] %x -> %x",
|
||||
|
Loading…
Reference in New Issue
Block a user