All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: jaegeuk@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: [f2fs-dev] [PATCH 2/3] f2fs: fix to update age extent correctly during truncation
Date: Tue, 31 Jan 2023 22:47:00 +0800	[thread overview]
Message-ID: <20230131144701.34418-2-chao@kernel.org> (raw)
In-Reply-To: <20230131144701.34418-1-chao@kernel.org>

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 <chao@kernel.org>
---
 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;
-- 
2.36.1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

WARNING: multiple messages have this Message-ID (diff)
From: Chao Yu <chao@kernel.org>
To: jaegeuk@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, Chao Yu <chao@kernel.org>
Subject: [PATCH 2/3] f2fs: fix to update age extent correctly during truncation
Date: Tue, 31 Jan 2023 22:47:00 +0800	[thread overview]
Message-ID: <20230131144701.34418-2-chao@kernel.org> (raw)
In-Reply-To: <20230131144701.34418-1-chao@kernel.org>

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 <chao@kernel.org>
---
 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;
-- 
2.36.1


  reply	other threads:[~2023-01-31 14:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-31 14:46 [f2fs-dev] [PATCH 1/3] f2fs: clean up __update_extent_tree_range() Chao Yu
2023-01-31 14:46 ` Chao Yu
2023-01-31 14:47 ` Chao Yu [this message]
2023-01-31 14:47   ` [PATCH 2/3] f2fs: fix to update age extent correctly during truncation Chao Yu
2023-01-31 14:47 ` [f2fs-dev] [PATCH 3/3] f2fs: fix to update age extent in f2fs_do_zero_range() Chao Yu
2023-01-31 14:47   ` Chao Yu
2023-01-31 18:56 ` [f2fs-dev] [PATCH 1/3] f2fs: clean up __update_extent_tree_range() Jaegeuk Kim
2023-01-31 18:56   ` Jaegeuk Kim
2023-02-01  8:53   ` [f2fs-dev] " Chao Yu
2023-02-01  8:53     ` Chao Yu
2023-02-06  3:41     ` [f2fs-dev] " Jaegeuk Kim
2023-02-06  3:41       ` Jaegeuk Kim
2023-02-07 12:33       ` [f2fs-dev] " Chao Yu
2023-02-07 12:33         ` Chao Yu
2023-01-31 19:10 ` [f2fs-dev] " patchwork-bot+f2fs
2023-01-31 19:10   ` patchwork-bot+f2fs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230131144701.34418-2-chao@kernel.org \
    --to=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.