* [PATCH] fsck.f2fs: always fix seg entry type if it is not DATA
@ 2017-01-24 2:45 Liu Xue
0 siblings, 0 replies; only message in thread
From: Liu Xue @ 2017-01-24 2:45 UTC (permalink / raw)
To: jaegeuk, piotr.karbowski; +Cc: linux-f2fs-devel
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>
---
fsck/fsck.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fsck/fsck.c b/fsck/fsck.c
index 0e5aa7c..854c1e3 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -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",
--
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-01-24 2:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-24 2:45 [PATCH] fsck.f2fs: always fix seg entry type if it is not DATA Liu Xue
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).