Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2648224rdb; Wed, 15 Nov 2023 06:57:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IHVWUftx2jQ2SRqyFU3atLy422ozFcU2T3sskn+zlRsunb1S3Ww1mnv+nMmwGSs/jkl/Rgq X-Received: by 2002:aa7:8512:0:b0:6c6:2885:82c7 with SMTP id v18-20020aa78512000000b006c6288582c7mr13004672pfn.25.1700060241155; Wed, 15 Nov 2023 06:57:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700060241; cv=none; d=google.com; s=arc-20160816; b=Jp3LSkRJCGGdq3BqjNupR41xCG5fYDiZh3yTpTGC2s/E44Oiz2l5qJLD6cWRRwAfQj X4M5tsJG+bG+LCeZwa5qXDuRTaOZ/mxBu47dcPMUBttA9aYxFUuQsLN3+aySLodDg8vR Ez9f4/rV6+sUVBypLX+FD8ja4vK8srKrC/+KFqNJxVrbotuT/jFUXL3Bcoypx7ZR8/dv ULR4Yx/LNheB9wjy1xrECHDZaSR+B7qlORfGSgavKnLkHl5Xy0fAB75HAtY1t3LEz95a 4u5XuqWNXWoO5xCX3hWLvlv1kaSq7tOH6HH46jn/uzMDC0JISQSUJEYOWKE2htViR0M3 o+Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=92MEAvYvaC8YEtZiHNidnapRwPjVt4JSanYNKB9xBoI=; fh=G4Pxduviz9cgWyQEq1k2zqRNcx1tgxoAEtGH9VlDFJM=; b=W2c2Qft5xgsSuf48bzQFndNm1ntWEJtWjV0lxU/paVoGYf+VdxBlh+eXCpdfZJDPxZ c6Plas64w0veCOIfsaQrfQFB3ygh6Ww93+QOpMRTVgNilirqKMbzPRmqRHTlqiUNzTV8 iFpGtGSWV60umcIv5n9uUqPOTgbvNwa9PR1O/BpwaT5fLd+Bzxc6WKhWPphE183uEdni ATXAS0r/VlpKFerR+GNQsshmBTaLq9S561wmhfhZtNwDvG1yjVBvfWpjGjRY1J3e+SIN rOtuta8gIIZsILn0/gVMdD+RV3ic1jwm8xu5adq7XM/VsjO1d6hT/YoJR/Kl1J5TbeX2 nzrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dQvpWSOr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id g22-20020a056a0023d600b006c431b8af26si10656674pfc.69.2023.11.15.06.57.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 06:57:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dQvpWSOr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 3C08A802407D; Wed, 15 Nov 2023 06:57:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344251AbjKOO5G (ORCPT + 99 others); Wed, 15 Nov 2023 09:57:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343929AbjKOO5F (ORCPT ); Wed, 15 Nov 2023 09:57:05 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 838568E for ; Wed, 15 Nov 2023 06:57:02 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D2EEC433C8; Wed, 15 Nov 2023 14:56:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700060222; bh=DbC/RlTt46G/vcvasCDLPs0jylhf+xjP8xII2Uu+weU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=dQvpWSOrDccdTNU5lSrfOvUM+KXPgaQi7dD9rDxVqWyXDm8+3FCwtvWBBnkhGd7tb E9ys82d1mwVUOpFIU0jD1fAoD9Rfb8zCq8ASsam/ughEJcjPmZ4JidyDpNkFFn0/Tu PvC/2GXhU+Js1Rwy9KBlBSvT84+nXc28Hh9tgctemyHC/+wif8Sxx0Tv6yScPwyXbv XpI9Dr/3r6TNrAIm/7drMX2N+Pw4KJqrT65mBlvB8UMmUUq5gO4Yw/t/CSn07UEhZK tKcmoOGalwISoNvbKitf/4WuU51De92NLjLk3NcIKExqSibc3RU1s0GP3kxeRyS8Wg hjURTfRCxS/kA== Message-ID: Date: Wed, 15 Nov 2023 22:56:57 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [f2fs-dev] [PATCH] f2fs-tools: do not put CP_UMOUNT_FLAG for roll forward recovery Content-Language: en-US To: Daeho Jeong , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Cc: Daeho Jeong References: <20231027154935.1384979-1-daeho43@gmail.com> From: Chao Yu In-Reply-To: <20231027154935.1384979-1-daeho43@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 15 Nov 2023 06:57:14 -0800 (PST) On 2023/10/27 23:49, Daeho Jeong wrote: > From: Daeho Jeong > > If we write CP_UMOUNT_FLAG in fsck, f2fs will not do foll forward recovery :s/foll/roll Otherwise, it looks good to me. Reviewed-by: Chao Yu Thanks, > even though it has to do. > > Signed-off-by: Daeho Jeong > --- > fsck/fsck.c | 3 ++- > fsck/mount.c | 5 ++++- > include/f2fs_fs.h | 1 + > 3 files changed, 7 insertions(+), 2 deletions(-) > > diff --git a/fsck/fsck.c b/fsck/fsck.c > index f1a55db..126458c 100644 > --- a/fsck/fsck.c > +++ b/fsck/fsck.c > @@ -2526,7 +2526,8 @@ static void fix_checkpoint(struct f2fs_sb_info *sbi) > struct f2fs_super_block *sb = F2FS_RAW_SUPER(sbi); > struct f2fs_checkpoint *cp = F2FS_CKPT(sbi); > unsigned long long cp_blk_no; > - u32 flags = c.alloc_failed ? CP_FSCK_FLAG: CP_UMOUNT_FLAG; > + u32 flags = c.alloc_failed ? CP_FSCK_FLAG : > + (c.roll_forward ? 0 : CP_UMOUNT_FLAG); > block_t orphan_blks = 0; > block_t cp_blocks; > u32 i; > diff --git a/fsck/mount.c b/fsck/mount.c > index 3b02d73..805671c 100644 > --- a/fsck/mount.c > +++ b/fsck/mount.c > @@ -3218,7 +3218,7 @@ void write_checkpoint(struct f2fs_sb_info *sbi) > struct f2fs_super_block *sb = F2FS_RAW_SUPER(sbi); > block_t orphan_blks = 0; > unsigned long long cp_blk_no; > - u32 flags = CP_UMOUNT_FLAG; > + u32 flags = c.roll_forward ? 0 : CP_UMOUNT_FLAG; > int i, ret; > uint32_t crc = 0; > > @@ -3837,6 +3837,9 @@ static int record_fsync_data(struct f2fs_sb_info *sbi) > if (ret) > goto out; > > + if (c.func == FSCK && inode_list.next != &inode_list) > + c.roll_forward = 1; > + > ret = late_build_segment_manager(sbi); > if (ret < 0) { > ERR_MSG("late_build_segment_manager failed\n"); > diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h > index abd5abf..faa5d6b 100644 > --- a/include/f2fs_fs.h > +++ b/include/f2fs_fs.h > @@ -1513,6 +1513,7 @@ struct f2fs_configuration { > unsigned int feature; /* defined features */ > unsigned int quota_bits; /* quota bits */ > time_t fixed_time; > + int roll_forward; > > /* mkfs parameters */ > int fake_seed;