fsck.f2fs: always fix seg entry type if it is not DATA
PATCH 1/1 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 <[email protected]>
Signed-off-by Liu Xue <[email protected]>
--- fsck/fsck.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fsck/fsck.c +2 -1
@@ -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",
Signature · 6 lines
2.10.1 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot