Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2163142ioo; Mon, 23 May 2022 11:35:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLToyhEX+gT4qQk/UjE7A3QomjHwDLWK09+T+5Y1KDTrU/iGJblqgeFRrrVcChxLIiWU2Z X-Received: by 2002:a17:903:18b:b0:162:3dfd:adb1 with SMTP id z11-20020a170903018b00b001623dfdadb1mr286106plg.122.1653330913338; Mon, 23 May 2022 11:35:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653330913; cv=none; d=google.com; s=arc-20160816; b=U5i3MJNfykA+8ihW09mBW8wW7sULcc1SAJwc2q9/fUtoznWMuhnKntuWnrw/bWhAMc OCilYaOrulvReMt2qa7cAIdH67qdAfPZ+/c7FEaMPSRh1H9STkxh9KtFJ8XUyDEiAHHs gS12gAmY0X+HFAsRN3Lidgn+hPCIi0yXem0LFAPojSPz++UqhpPotT+sr+N4OsEZhGUx sIi7DJoxr13gHl3ENr9JtgV/XLeVg49nHDh0EOROBuWz8BvS926ZJgpZVCLEO1OqCMiJ EhodjxDTozw4UY3Xiser7zvc1zmnjENDLuo30teJVqZXSLfMYspfM/AQB2Ple6InXJLH dtaw== 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=2niP0CGFUFFSj5QYgr4e5myJD6KAAyP1rALrcyzyXxc=; b=amz+jDefg7lLLGcv51kigD7hL2SNRzcRMzqHscOci82CBE06ux6r0QJY01igJYQtTi w5muEqM/vdF/qTMvauZLpsh2r4i12/ewIz37le8DMjGRH+QhYiW/5BhvSBXUViTkBDF2 6AQNncWxhpmsrKCse77gV58KUwTN8vRcSFYPVPIAuVA90VJbkt1tFjFtDQJs3vSqfPV3 1IBqqRpQgeQvjEwJPh04w21xeJjb7DKUYW7pfTF+lzJb7yr6isyQOauKWuztHurJ3egS eTs/am2+7RF6SQZYh6cOilzXK/zFoIkHkok5WouHpg5FPdGI8NPR+FwKywdaFniYUINg jMyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AclNuXRe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i19-20020a63d453000000b003f61c53901bsi10618193pgj.385.2022.05.23.11.35.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 11:35:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AclNuXRe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DC83E49CAE; Mon, 23 May 2022 11:34:00 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235882AbiEWSa3 (ORCPT + 99 others); Mon, 23 May 2022 14:30:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237447AbiEWS3x (ORCPT ); Mon, 23 May 2022 14:29:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5768EAB89 for ; Mon, 23 May 2022 11:04:15 -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 ams.source.kernel.org (Postfix) with ESMTPS id 36A0FB81210 for ; Mon, 23 May 2022 18:03:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A80D1C385AA; Mon, 23 May 2022 18:03:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653329019; bh=Yb/JkZM658Z6MLcMI0IHk5BK/rh9v+MSZ1PRr3wJnv0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AclNuXReOE8lhJhX5Dnq4OBTo2fIHyceusJLNbQJoawzNKkkQJX5Z/+IM+tJPUFvx SEFLwnTws/41SkR3rMU4AdsJT3SUpn1y+PAH3XdSz+ED1eYUQa69pGT0ExB7upg5rm oIjb6TqjhoNhYtm6ajCT0e/ZsLxQxWkQBRu2Ly4yU3cPHuOm9Hpeoh9IWqlWb3ZC3i r8NYYVzR/Mh03nUuRWarCd9Lt41leQNQyWGcPPlEgMEUqWwa4DaDI9BQC0weohk4pQ 0mS8x141JZWY9n382fP4gxblQ6gten/fcv74HX9WIbJLVJAQY8/NLR9uE0O0mN8oww TEc8BylmI7yFA== Date: Mon, 23 May 2022 11:03:37 -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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > 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. > > Thanks, > > > _______________________________________________ > Linux-f2fs-devel mailing list > Linux-f2fs-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel