From patchwork Tue Jan 31 14:46:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chao Yu X-Patchwork-Id: 50901 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2790595wrn; Tue, 31 Jan 2023 06:47:41 -0800 (PST) X-Google-Smtp-Source: AK7set+EwZXUj7RsJsu3LMTi83a1B1GWwg49/4Iyz0ExcZZL8fTE2FchgHI+qDsC0yej8256uwar X-Received: by 2002:a05:6a21:9005:b0:bc:93c7:96ad with SMTP id tq5-20020a056a21900500b000bc93c796admr10013733pzb.12.1675176461035; Tue, 31 Jan 2023 06:47:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675176461; cv=none; d=google.com; s=arc-20160816; b=UnJ4rbQeEh3nmCiau9FlW5i7YsPeo10X65nMu7iBmS5JugDoRofjjbpZNvNuzsBFga ESc0N15/c/PjPhxS6RNawwfH3fTJ29u+R3hvB3tz82vCQP18aXZ7pOTZvr/RI2rdWW7i A5TbRGvA+tlGgEN1duYHH0eVzoyznojk/vtj/X/lStmBdbp6bItremZLqgURZzo/T3FY NjZi3tjqSrrWsJeF5g3l8CMaXURInstylFlnUot5lNYX9qofjgk1plRKT7vy6rDtRwE5 mGT2mKVuhFAPMa0Yi3K4TwA4fqOXeVMpIAWeg7r83lp+LqPSX1eXlDpinGb4oVrY1SMf /iGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+FGTf5HuvO5/puVIx6bwuBMFZQlk4rXc/PUC03GODvA=; b=wXBT2zl+iptXpwBs6ChR6Ti7pagZbEt/41tBbz7DnS6lggTkQvIeSfbSDZLfWUGqWL JotnOMcVscV4dgFM9fAEUoDI7Hu4aoyWt794IR5CA7oABqoOOvkm7siun23tb5I+Wviv 58b0lR9p5tNEH6NO+E0R6NBR6RzoCvkwG9F8esRH0Kzv0+hMpWhXDgANG0S3PW9dFeU6 J9b+iH8GxsW7+3G/Z/uUE3/Iv1gi5/g7IV3vJqbf10UID2X2A1TGzAIG77KRvJq3Sxlx X9rfCeP0zWnQb0dLMJcQzCmot2TgQfDVSUUelZu1YU9WGhMcLXPr34GT8p3MkEk1dktD EefQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WSgUT5zF; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i11-20020a63bf4b000000b004b377960752si15410131pgo.353.2023.01.31.06.47.28; Tue, 31 Jan 2023 06:47:41 -0800 (PST) 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=WSgUT5zF; 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 S231968AbjAaOrK (ORCPT + 99 others); Tue, 31 Jan 2023 09:47:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231910AbjAaOrJ (ORCPT ); Tue, 31 Jan 2023 09:47:09 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3C1C46727 for ; Tue, 31 Jan 2023 06:47:07 -0800 (PST) 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 7687661489 for ; Tue, 31 Jan 2023 14:47:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2456CC4339B; Tue, 31 Jan 2023 14:47:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675176426; bh=MmOxigM59X8JlcAHThlYTmmNijEJl7O6QUjLV9hpxdU=; h=From:To:Cc:Subject:Date:From; b=WSgUT5zF8Y2q8+duHXiW8g+tcnUn16069rvwvf8xaKL8/mDJAaqVDHG0Y3JMhplgg tKMSGbfB1liLsTfja/zODR7ZrbxJpocaSHAxnGZ3A1sJcQe6CsKPUS+W9rnt1JPTUn 5cYPmTkBSjaHktth2/i8hUa1AKDA+phUWfml4Gmm9GmWL6UMBxusf8ATwiw8ULjL2L 0nFiC06B3b9LFjZCf11QuDydPeaNNz1F6H+oXiV17rlVcxTwm2+5G09fW5FZ+ao4Gv 4whexxOWEJZxq1DI+SxxlFluyIMrPaX8LqPZ3XJajBL5OIUgFBx+yImGM5EyB+M7LW mGiSLhDazvA4g== From: Chao Yu To: jaegeuk@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Chao Yu Subject: [PATCH 1/3] f2fs: clean up __update_extent_tree_range() Date: Tue, 31 Jan 2023 22:46:59 +0800 Message-Id: <20230131144701.34418-1-chao@kernel.org> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756549832646705987?= X-GMAIL-MSGID: =?utf-8?q?1756549832646705987?= No logic change, just avoid goto statement. Signed-off-by: Chao Yu Signed-off-by: Chao Yu --- fs/f2fs/extent_cache.c | 66 ++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c index d70ad6a44cbf..cf65a188d112 100644 --- a/fs/f2fs/extent_cache.c +++ b/fs/f2fs/extent_cache.c @@ -782,47 +782,43 @@ static void __update_extent_tree_range(struct inode *inode, en = next_en; } - if (type == EX_BLOCK_AGE) - goto update_age_extent_cache; - - /* 3. update extent in read extent cache */ - BUG_ON(type != EX_READ); - - if (tei->blk) { - __set_extent_info(&ei, fofs, len, tei->blk, false, - 0, 0, EX_READ); - if (!__try_merge_extent_node(sbi, et, &ei, prev_en, next_en)) - __insert_extent_tree(sbi, et, &ei, + /* 3. update extent in extent cache */ + if (type == EX_READ) { + if (tei->blk) { + __set_extent_info(&ei, fofs, len, tei->blk, false, + 0, 0, EX_READ); + if (!__try_merge_extent_node(sbi, et, &ei, + prev_en, next_en)) + __insert_extent_tree(sbi, et, &ei, insert_p, insert_parent, leftmost); - /* give up extent_cache, if split and small updates happen */ - if (dei.len >= 1 && - prev.len < F2FS_MIN_EXTENT_LEN && - et->largest.len < F2FS_MIN_EXTENT_LEN) { - et->largest.len = 0; - et->largest_updated = true; - set_inode_flag(inode, FI_NO_EXTENT); + /* give up read extent cache, if split and small updates happen */ + if (dei.len >= 1 && + prev.len < F2FS_MIN_EXTENT_LEN && + et->largest.len < F2FS_MIN_EXTENT_LEN) { + et->largest.len = 0; + et->largest_updated = true; + set_inode_flag(inode, FI_NO_EXTENT); + } } - } - - if (is_inode_flag_set(inode, FI_NO_EXTENT)) - __free_extent_tree(sbi, et); - if (et->largest_updated) { - et->largest_updated = false; - updated = true; - } - goto out_read_extent_cache; -update_age_extent_cache: - if (!tei->last_blocks) - goto out_read_extent_cache; + if (is_inode_flag_set(inode, FI_NO_EXTENT)) + __free_extent_tree(sbi, et); - __set_extent_info(&ei, fofs, len, 0, false, - tei->age, tei->last_blocks, EX_BLOCK_AGE); - if (!__try_merge_extent_node(sbi, et, &ei, prev_en, next_en)) - __insert_extent_tree(sbi, et, &ei, + if (et->largest_updated) { + et->largest_updated = false; + updated = true; + } + } else if (type == EX_BLOCK_AGE) { + if (tei->last_blocks) { + __set_extent_info(&ei, fofs, len, 0, false, + tei->age, tei->last_blocks, EX_BLOCK_AGE); + if (!__try_merge_extent_node(sbi, et, &ei, + prev_en, next_en)) + __insert_extent_tree(sbi, et, &ei, insert_p, insert_parent, leftmost); -out_read_extent_cache: + } + } write_unlock(&et->lock); if (updated) From patchwork Tue Jan 31 14:47:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chao Yu X-Patchwork-Id: 50906 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2795116wrn; Tue, 31 Jan 2023 06:57:59 -0800 (PST) X-Google-Smtp-Source: AK7set/HHWxWpA8eACs8mLIAbVuZdhU/EV/DFCW/4B55pi+8uAFRZs3rfqijC4B/fqZzgeZt1hie X-Received: by 2002:a17:907:11cf:b0:88c:7a36:d11e with SMTP id va15-20020a17090711cf00b0088c7a36d11emr2266869ejb.25.1675177079586; Tue, 31 Jan 2023 06:57:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675177079; cv=none; d=google.com; s=arc-20160816; b=R+OgYaU5uT4a+Fo+QrqEdc3TcRpbZvjseH/bBmudKlXK76w41pjx2LsQwQfhYIs7mC Bt3b9Xkhw2Wn+EQ0H7N2DW5nE3NmW8Y2pGBh46zqR2hI4XqE5/l2uAQna31iYVMS1AIg hanHFcvp8gwAn7RPdk/oBN4P3HeLh29TbsQP2Mc8HYS78HEOvFGjdSOj0g8gQS5+gs9/ pYTOBU2MAui90ijRZXSG8qXCYdMkZD0jecLI+GGMsuU/oHJGy+Z9+EBbxM9UtNY3mtD2 BQZxSVYc9dltltcLVAjIHBKWJEnXm3twj9hTAO6pBwwBKEpDaU+B77HKpCQSHLLnB6me +wQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=k0XiL2kyugc3JB/+w2qrgOL85fTuK5IXAnFJk5vQyZo=; b=fqDGYJ3whrLn+HHxSbQtVUbZBS6/Kubv2fH5+u+B8alX/JFhFzHevhVhnlxSwXnhCg nLJqJcHxRSz1xswiHk0f0sr9D7N1WFh2juU2hbN4aC/xuD1cFVd/U7jHHqHHbi9gNFIC OBtbTgwelN1FIfjs1z0lf6Pw4bRi31poEqix+Lf0jy7ChNCbomgHpgIlSmnIoNV2ZaD6 k2VAb6owDGx3Vl0PsxmVRcILSHYv8LYgH5x2roypykPhcblEC68QUndg+nGRkN5Sf4TN 6y3ltZEhBXHmYmDqV96W5gkLO5/v0g9c5yEVR0BaXhjlagZ3wsDhw9l0V1bYQiXEnskx BbZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sOYe00Am; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fd4-20020a1709072a0400b008707dc6131bsi16014603ejc.582.2023.01.31.06.57.18; Tue, 31 Jan 2023 06:57:59 -0800 (PST) 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=sOYe00Am; 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 S231964AbjAaOrM (ORCPT + 99 others); Tue, 31 Jan 2023 09:47:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231934AbjAaOrK (ORCPT ); Tue, 31 Jan 2023 09:47:10 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A82545F45 for ; Tue, 31 Jan 2023 06:47:09 -0800 (PST) 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 EC72E61548 for ; Tue, 31 Jan 2023 14:47:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49B84C433EF; Tue, 31 Jan 2023 14:47:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675176428; bh=qLSS2GASRL8RKpxdXDWhe4iVsIVVZ3UeUtKqaOGvO0c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sOYe00Am1ogdvGACUfNzfDLl7Vazf31h+dx1uwjgSsY8+82XiJJxXzz7kypcFN5Il O4Z50WMV/rsQiKRF34E/fOJrKodWsjm5nDkK6FPpPj179zCkmIlKLtxx2AzCPMyofr xrF4s9nNeBgpV/5KybxZtsBmauh8rUsKE2+UtkOVASTOPI4+tE5Hgn+eeXn0YUZmY5 Bc1pRXjwsQ6LtyEfQ36lRVkZNrrx4PWRzLlnoNISmky/bNgms8GZy910hAe7HGcg13 85A3idfKezrp19KjRnupUbkL7+XmNzu0pdFa3pI2B+QISFgD768PCWJ5YHvoJ3XxbR vh0tZ4DiwIT1A== From: Chao Yu To: jaegeuk@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Chao Yu Subject: [PATCH 2/3] f2fs: fix to update age extent correctly during truncation Date: Tue, 31 Jan 2023 22:47:00 +0800 Message-Id: <20230131144701.34418-2-chao@kernel.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20230131144701.34418-1-chao@kernel.org> References: <20230131144701.34418-1-chao@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756550481171896065?= X-GMAIL-MSGID: =?utf-8?q?1756550481171896065?= nr_free may be less than len, we should update age extent cache w/ range [fofs, len] rather than [fofs, nr_free]. Fixes: 71644dff4811 ("f2fs: add block_age-based extent cache") Signed-off-by: Chao Yu --- fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index f4de96a3744b..746ffcd09b6c 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -617,7 +617,7 @@ void f2fs_truncate_data_blocks_range(struct dnode_of_data *dn, int count) fofs = f2fs_start_bidx_of_node(ofs_of_node(dn->node_page), dn->inode) + ofs; f2fs_update_read_extent_cache_range(dn, fofs, 0, len); - f2fs_update_age_extent_cache_range(dn, fofs, nr_free); + f2fs_update_age_extent_cache_range(dn, fofs, len); dec_valid_block_count(sbi, dn->inode, nr_free); } dn->ofs_in_node = ofs; From patchwork Tue Jan 31 14:47:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chao Yu X-Patchwork-Id: 50904 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2792859wrn; Tue, 31 Jan 2023 06:53:02 -0800 (PST) X-Google-Smtp-Source: AK7set/hRd9EAwpdp4yuotaRsPZL6qO0N0rVlw4mIw49aIgQCyxBtCKZBoZQ1o9hZIYwGvH2Xg9r X-Received: by 2002:aa7:de90:0:b0:4a0:b63a:119f with SMTP id j16-20020aa7de90000000b004a0b63a119fmr21079855edv.30.1675176781809; Tue, 31 Jan 2023 06:53:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675176781; cv=none; d=google.com; s=arc-20160816; b=PT7UfN2QSkelw1YiyB5ugPwK5xCrXUoYvECMKBYhvXygiTCuexd+k2siSxWQk0Zrj9 IoVHoooScc55G/r/a76VjwHgQQ4NFwls/7wWqI9CLUh5svR2JHg5c7g06/q2PjQcGJGr IdatTn2ZCBDKJ0xCWlEv5yJIUsxmbGMEXM29ymPYJkFnI0FZGTayocwKqAMmFL6qaNjW cYZFjgEPjfEzugcQJkIWV++VWMOhcu+Rma4sPIzGvjkVHiSyy5+zGHf5SjV3D2upYQ+C rCJQJ3GNI8ccMEDMui6wQ4/D/xXf7znIg3l1rctB+mCAYXNswfVVZDFjo7FYMQxYmdS/ S0uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GmNaIi+ixbD4cZnUhvF4wZ45ugwmMIQjvPAb9K7xk88=; b=ui3+f8kaY6yO4GrNHD7QoxYPeNDQ3zZehc5m/Evsb+tjdJczttHdP4aV8PjUfTkuFj Yq9/dLJbPBXFK544pEZaSTkmhvSsLZc0/1IJMujfNMgM3BM3WudNrOsikwBEcvCvaicA NV/ZDev8/d1Shs8O1dCNqx42KyQ7hAX7j6Raje+TWJoEXjjqg5kau1J4bNhzOG+6rMzm gNIwwfZJurUAfPLuzgqK6oXiJRy++KpkWmvmPfVzxLLAsW2KRIRdesIjhASbdU8iyGP2 StzZNbURcjGm/QT19Azd7/YRdB6DruqTVa/Ahq37SXoZ6Dv+7s/Eyys9bvD1GATIy+mh m1Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cHNqm69t; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x9-20020aa7d389000000b004a20ae6d689si12937581edq.179.2023.01.31.06.52.15; Tue, 31 Jan 2023 06:53:01 -0800 (PST) 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=cHNqm69t; 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 S232001AbjAaOrV (ORCPT + 99 others); Tue, 31 Jan 2023 09:47:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231994AbjAaOrN (ORCPT ); Tue, 31 Jan 2023 09:47:13 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC0CD4859F for ; Tue, 31 Jan 2023 06:47:12 -0800 (PST) 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 8BFBCB81D1C for ; Tue, 31 Jan 2023 14:47:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2603EC4339C; Tue, 31 Jan 2023 14:47:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675176430; bh=fHwIuqaUuMg5+WXKD6YgXPsdEqVlJYuXKPQIpe6n52A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cHNqm69tdUwpoBfLCMhg7nBegkoqKVbDKXOdq61CYE7/k0DP9jA3TkEXyYogDWAO7 UFpUztxi7RoVBfibSn8vg78LvzH26y+/4yuUrUcLEe9aeZvrHjG7EO6lVsEePsCyzF FDpnUDnmf3O8QvLb0F+7gSLEQ+PaNBG5C7zjdh/n9Py4mppEpKcEEeBH6JrNXGLFtm LGr2P35GfCPWrk+7MnMckVIXq1eM8+Cu/5UkfAzn7jkV3XscXcwQlJ6hs/48cgA/3/ O0pG8TfMe46nppq0SMLzvDoQ0g7z4t7VuCq7Lo+e5q6tmgl3we9U3UTVvbnUqPSC2X Wl+1AXgyVURMg== From: Chao Yu To: jaegeuk@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Chao Yu Subject: [PATCH 3/3] f2fs: fix to update age extent in f2fs_do_zero_range() Date: Tue, 31 Jan 2023 22:47:01 +0800 Message-Id: <20230131144701.34418-3-chao@kernel.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20230131144701.34418-1-chao@kernel.org> References: <20230131144701.34418-1-chao@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756550168910555519?= X-GMAIL-MSGID: =?utf-8?q?1756550168910555519?= We should update age extent in f2fs_do_zero_range() like we did in f2fs_truncate_data_blocks_range(). Fixes: 71644dff4811 ("f2fs: add block_age-based extent cache") Signed-off-by: Chao Yu --- fs/f2fs/file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 746ffcd09b6c..60488749c35e 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1494,6 +1494,7 @@ static int f2fs_do_zero_range(struct dnode_of_data *dn, pgoff_t start, } f2fs_update_read_extent_cache_range(dn, start, 0, index - start); + f2fs_update_age_extent_cache_range(dn, start, index - start); return ret; }