Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3276164ioo; Tue, 24 May 2022 18:32:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+w3n58Cu6Cz1RbNcVksegdlz7bIk/UL6+QmAGj0o0t77gkqhWO6Z4cC9KUAYTsQaqgkTA X-Received: by 2002:a17:90b:1d90:b0:1df:d0ae:1443 with SMTP id pf16-20020a17090b1d9000b001dfd0ae1443mr7589924pjb.122.1653442351612; Tue, 24 May 2022 18:32:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653442351; cv=none; d=google.com; s=arc-20160816; b=S5uIldWbrghqxnN+31UFGxgayVTEgwgQiSjYlwp2b+NUCsFj1YFO7PQ7TwFBox0tuo 1f+Etu+Arx4qbrZWC7fXU6KC0cxboiBDMrAJb9M+CKzzNMDKcuYXKGithmjGq9PtCzRW fScZn9YMmSp0or5BSO1j+5X+yG5N1wqDMYAq8NZbLnyriuSWrzTgAM8k+6QBvXdYygCp j0zPXGJD2wKS/5auTJtgFJo+GNPnweWZ0CCz2YmrKrAGAZMkfU6ZA6S3FQOlZb2jECpI eINS0Olo0CD5cHRs7ijwApxdaAzBnZGfHPXKRYJuPWEjnTc5rQKRSQNYAyQZ+fEfbYv2 pAlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=uBuhfGI5zGEpbbBJ0zuaUuRd/xyV/cJJyhheiKsecdY=; b=Tarj2Jp7O/f4M270dTL18lUCP6sg2uPG6HFoq4K1XWtqrL4C2sVPeMSVZMh8G0nGG6 xsb63yMZEj4k/2eTC71r5H4+R2r6rM6KoKhyn8XwakcnSZLjl0yFULNIFvOZusf1dq7/ 9wX0oGtrM844DwS3mZq0qncbr+RQ6fFguLK4SOg2o4ddudh98izXTJnXNLwfP/mmhAv/ ooN8OFvFuZUm5TvIFULp0CoZj9MVSy3PaP4zqxnllFq2d8Ghsyk6dfy1suzMWnDgLLk3 M0MQrLXPk+5kYvhsMOGN5L8KrJTxsVS+NzRm/Y9flvMUcYuKP+OA4JufiYqirmJ2doLs fblw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bQBRLUIB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n16-20020a170902d2d000b00153b2d1645bsi16562164plc.99.2022.05.24.18.32.17; Tue, 24 May 2022 18:32:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bQBRLUIB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231519AbiEXP0n (ORCPT + 99 others); Tue, 24 May 2022 11:26:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238859AbiEXP0e (ORCPT ); Tue, 24 May 2022 11:26:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B939C2E9CC for ; Tue, 24 May 2022 08:26:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 53E8D61716 for ; Tue, 24 May 2022 15:26:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CBCAC34113; Tue, 24 May 2022 15:26:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653405992; bh=lXzHpD73ZNq/mGAnzxwqk68q+3cpJPWaCAtRV53tatI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bQBRLUIB+CzIv9geGx/fXV1J6eBqxc8uSBz22ga34tMA74Tt6sznwf8zUq/13AD3g pdGVCep8TGTDLVFsFsup31isXOho6wgY/+Q7cecYJW4bfL8ItsMkFwlpgkQ3ZMq4oG 5tVMDxUuYnY2Akhqw//Z6OkkPHiPqOs+3hdTszjVtvIuCh875iDjkFjTjaujORqKdG KTofWputI5KayJewQ7P0ObQiZQIRQhM5kWEAxlEZA+yp/AoDk/Xa3+MKWg25TPAdxg WI01dlqWihXad0nm824+pzM/hhnXzEElVIjFBQbYNo1TDOsFT2LGR59Ui0zVuhcVI5 08TvHm8JXTg2Q== Date: Tue, 24 May 2022 08:26:30 -0700 From: Jaegeuk Kim To: Chao Yu Cc: Daeho Jeong , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com, Daeho Jeong Subject: Re: [f2fs-dev] [PATCH v3] f2fs: change the current atomic write way Message-ID: References: <20220428181809.2352352-1-daeho43@gmail.com> <227d10d5-2afe-acfa-7cfc-3a2f45331c6f@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <227d10d5-2afe-acfa-7cfc-3a2f45331c6f@kernel.org> X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/24, Chao Yu wrote: > On 2022/5/24 2:03, Jaegeuk Kim wrote: > > On 05/22, Chao Yu wrote: > > > On 2022/4/29 2:18, Daeho Jeong wrote:> + *old_addr = dn.data_blkaddr; > > > > + f2fs_truncate_data_blocks_range(&dn, 1); > > > > + dec_valid_block_count(sbi, F2FS_I(inode)->cow_inode, count); > > > > + inc_valid_block_count(sbi, inode, &count); > > > > + f2fs_replace_block(sbi, &dn, dn.data_blkaddr, new_addr, > > > > + ni.version, true, false); > > > > > > My concern is, if cow_inode's data was persisted into previous checkpoint, > > > and then f2fs_replace_block() will update SSA from cow_inode to inode? > > > > SSA for original file is intact, so we'll see the orignal file's block addresses > > and SSA, if we flush cow_inode's SSA after committing the atomic writes? > > It'd be good to flush any SSA for cow_inode, since we'll truncate > > cow_inode after powercut by the ohphan recovery? > > I think it's safe for recovery flow, but before that, fsck will report inconsistent > status during checking orphan atomic_write inode. That should be fine as well, since it'll just drop that cow_inode. > > Thanks, > > > > > > it will cause inconsistent status of last valid checkpoint? Or am I mssing > > > something? > > > > > > > - f2fs_submit_merged_write_cond(sbi, inode, NULL, 0, DATA); > > > > + new = f2fs_kmem_cache_alloc(revoke_entry_slab, GFP_NOFS, > > > > + true, NULL); > > > > + if (!new) { > > > > + f2fs_put_dnode(&dn); > > > > + ret = -ENOMEM; > > > > + goto out; > > > > > > It doesn't need to handle failure of f2fs_kmem_cache_alloc() > > > due to nofail parameter is true. Let's get this by another patch. Could you please send one? > > > > > > Thanks, > > > > > > > > > _______________________________________________ > > > Linux-f2fs-devel mailing list > > > Linux-f2fs-devel@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel