Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751111AbdIKKcg (ORCPT ); Mon, 11 Sep 2017 06:32:36 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:6017 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750991AbdIKKcf (ORCPT ); Mon, 11 Sep 2017 06:32:35 -0400 Subject: Re: [PATCH] f2fs-tools: support CP_CRC_RECOVERY_FLAG check To: Yunlong Song , , , CC: , , , , References: <1504794297-150702-1-git-send-email-yunlong.song@huawei.com> From: Chao Yu Message-ID: Date: Mon, 11 Sep 2017 18:32:13 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1504794297-150702-1-git-send-email-yunlong.song@huawei.com> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A0B0206.59B6663A.003A,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 2b547fad2b522f4b17579a2d6b85a875 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1267 Lines: 42 Hi Yunlong, Do we need to recover other flags? Thanks, On 2017/9/7 22:24, Yunlong Song wrote: > Signed-off-by: Yunlong Song > --- > fsck/fsck.c | 3 +++ > fsck/mount.c | 3 +++ > 2 files changed, 6 insertions(+) > > diff --git a/fsck/fsck.c b/fsck/fsck.c > index cb341ba..f63a609 100644 > --- a/fsck/fsck.c > +++ b/fsck/fsck.c > @@ -1786,6 +1786,9 @@ static void fix_checkpoint(struct f2fs_sb_info *sbi) > set_cp(cp_pack_total_block_count, 8 + orphan_blks + get_sb(cp_payload)); > > flags = update_nat_bits_flags(sb, cp, flags); > + > + if (is_set_ckpt_flags(cp, CP_CRC_RECOVERY_FLAG)) > + flags |= CP_CRC_RECOVERY_FLAG; > set_cp(ckpt_flags, flags); > > set_cp(free_segment_count, get_free_segments(sbi)); > diff --git a/fsck/mount.c b/fsck/mount.c > index 7a8aeae..0d77cce 100644 > --- a/fsck/mount.c > +++ b/fsck/mount.c > @@ -1902,6 +1902,9 @@ void write_checkpoint(struct f2fs_sb_info *sbi) > set_cp(cp_pack_total_block_count, 8 + orphan_blks + get_sb(cp_payload)); > > flags = update_nat_bits_flags(sb, cp, flags); > + > + if (is_set_ckpt_flags(cp, CP_CRC_RECOVERY_FLAG)) > + flags |= CP_CRC_RECOVERY_FLAG; > set_cp(ckpt_flags, flags); > > crc = f2fs_cal_crc32(F2FS_SUPER_MAGIC, cp, CHECKSUM_OFFSET); >