From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga05-in.huawei.com ([45.249.212.191]:6028 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750957AbdILBUd (ORCPT ); Mon, 11 Sep 2017 21:20:33 -0400 Subject: Re: [PATCH] f2fs-tools: move_curseg_info only if check_curseg_offset fails To: Yunlong Song , , , CC: , , , , References: <1505060436-45299-1-git-send-email-yunlong.song@huawei.com> From: Chao Yu Message-ID: <150fcefc-416e-7132-752a-c37f7ad88bf3@huawei.com> Date: Tue, 12 Sep 2017 09:19:19 +0800 MIME-Version: 1.0 In-Reply-To: <1505060436-45299-1-git-send-email-yunlong.song@huawei.com> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 2017/9/11 0:20, Yunlong Song wrote: > Current design will lose recovery process when check_curseg_offset is OK. > > Signed-off-by: Yunlong Song Reviewed-by: Chao Yu > --- > 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); >