Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3277471lfo; Mon, 23 May 2022 00:31:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/oyV1XZKAQkU2CI5Ne8/NYnYViwE+5V2I6Mamj5LdHTJJhU/d+GDhEHaRfhQhHa9qOAdi X-Received: by 2002:a05:6a00:299a:b0:518:9489:2c32 with SMTP id cj26-20020a056a00299a00b0051894892c32mr6697063pfb.29.1653291068377; Mon, 23 May 2022 00:31:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653291068; cv=none; d=google.com; s=arc-20160816; b=p4YYj5kbXMO6yfrFNAGtYjyLM4jwLNWyllF1etwSK5KkRiuf5cFIJTKRFumlVxqJ/1 +3Ps2r5Gs3Agmn7HuhoxMmpM/tqVG/llZA+1sHY034ofQvZ52RuQ2clCYm537dEO+Cag HCp4ZXWWoxI28f1+xRhstNqaoIvr0cLNYDBQs5M9MRpZaw9Yh9JHvIIBSTN6nd+zH+lA rM50MrfkBEBEJq3W8P8S9cpgHBAWDrIVYtIdiBCn9XrO5aL0Gko6qcptHNA8kLizB5M0 I+/YHJJ1P2uZQkonNL9oW9j7KhX6+syZ6ctKPLlRHbpWa5z31LbIxwLaduCgvECu5hWb et/g== 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=6KbHIXF7N9Dlyw5KImDqQ94RjAx50SYBK6rjfiVp8s4=; b=FN51DsOGNLwej7rHZ3hvKklCSIEQB2SWWzAiW92FuLW6QIobN5BFvvob+GH3OBaBrv Xf49sMXHg6qhEwX0smasfBQ4fYqkQr3807Kmj/KbYoRLbDr4QgfwJiu9RTUQT9bKlD+Z 08TkvdT52T5NeMpH2pMmlU+u5fr2o+y8GDbInZWScqjfGCg6IjpwneySU9fC2VqonxGj 4+9DoyUT2zCKpcX5Iq+i1Kyxjr96c6v0sHLR0ZQh2ozJsNX1D5stonGnuDP/eQn4STTB pWzmqhwoLQAOzyzM10cFPfC9giwiZ1WYPAsTa7PM1OUv6fLmDAtLKFCIWgtG5fHVet3d Ning== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="aHQE+A/M"; 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 h2-20020a170902b94200b00158da867027si340312pls.624.2022.05.23.00.31.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 00:31:08 -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="aHQE+A/M"; 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 out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D4D98149175; Sun, 22 May 2022 23:43:18 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345206AbiEVMoB (ORCPT + 99 others); Sun, 22 May 2022 08:44:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239267AbiEVMoA (ORCPT ); Sun, 22 May 2022 08:44:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 233E53584A for ; Sun, 22 May 2022 05:44:00 -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 9976360FB7 for ; Sun, 22 May 2022 12:43:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1534CC385AA; Sun, 22 May 2022 12:43:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653223439; bh=DEteYEjM+AM/wXkRopNu1+2DJQAvofJ3C+iGOSkSiPA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=aHQE+A/MzK8H3SZ55YRN+/j56oazYVYQ9CsJl4y5fwEWnyK/Mijf4P0TQydnVpQTW dHM6eZx5jem8IvprgD7NqgxO7DjguXTtSlODsjo8H2B9v/8FQjojehfc/XAMeZM8bL ur1UaNIQs+WL1Pu3JhBL3yoydHFApgCNfj66Sbtz9vdJ8gzoqFOs+SmpR2SMNCrMue lZqyuGuBssNW3FLeP/nJ2nzczX0+mGiihmn/KXi8J22SPPSPFJodYDl/hYrOwYCjSZ H6yELqghWGGdFqkfNOI+CbFPtmCZiNqY5l/8g1s+45D9DQuVUJxKw700UcYjtHvIE2 yr6ayKVyAJbdQ== Message-ID: Date: Sun, 22 May 2022 20:43:56 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [f2fs-dev] [PATCH v3] f2fs: change the current atomic write way 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: <20220428181809.2352352-1-daeho43@gmail.com> From: Chao Yu In-Reply-To: <20220428181809.2352352-1-daeho43@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, NICE_REPLY_A,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 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? 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,