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:
Liu Xue 2017-01-24 10:45:47 +08:00 committed by Jaegeuk Kim
parent ada65254f6
commit 5d9032fd1b

View File

@ -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",