lkml.org 
[lkml]   [2017]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] f2fs-tools: move_curseg_info only if check_curseg_offset fails
Date
Current design will lose recovery process when check_curseg_offset is OK.

Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
---
fsck/fsck.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/fsck/fsck.c b/fsck/fsck.c
index cb341ba..56a47be 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -2026,9 +2026,11 @@ int fsck_verify(struct f2fs_sb_info *sbi)
fix_hard_links(sbi);
fix_nat_entries(sbi);
rewrite_sit_area_bitmap(sbi);
- move_curseg_info(sbi, SM_I(sbi)->main_blkaddr);
- write_curseg_info(sbi);
- flush_curseg_sit_entries(sbi);
+ if (check_curseg_offset(sbi)) {
+ move_curseg_info(sbi, SM_I(sbi)->main_blkaddr);
+ write_curseg_info(sbi);
+ flush_curseg_sit_entries(sbi);
+ }
fix_checkpoint(sbi);
} else if (is_set_ckpt_flags(cp, CP_FSCK_FLAG)) {
write_checkpoint(sbi);
--
1.8.5.2
\
 
 \ /
  Last update: 2017-09-10 18:21    [W:0.027 / U:1.796 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site