Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755471AbdIGOZO (ORCPT ); Thu, 7 Sep 2017 10:25:14 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5573 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755450AbdIGOZM (ORCPT ); Thu, 7 Sep 2017 10:25:12 -0400 From: Yunlong Song To: , , , , CC: , , , , Subject: [PATCH] f2fs-tools: support CP_CRC_RECOVERY_FLAG check Date: Thu, 7 Sep 2017 22:24:57 +0800 Message-ID: <1504794297-150702-1-git-send-email-yunlong.song@huawei.com> X-Mailer: git-send-email 1.8.5.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.107.193.250] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A0B0208.59B156C7.005C,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: 4c6b4ef035d833dbf02bca8a5226486e Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1111 Lines: 36 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); -- 1.8.5.2