[PATCH] f2fs: write missing last sum blk of file pinning section

Daeho Jeong posted 1 patch 1 year, 10 months ago
fs/f2fs/segment.c | 2 ++
1 file changed, 2 insertions(+)
[PATCH] f2fs: write missing last sum blk of file pinning section
Posted by Daeho Jeong 1 year, 10 months ago
From: Daeho Jeong <daehojeong@google.com>

While do not allocating a new section in advance for file pinning area, I
missed that we should write the sum block for the last segment of a file
pinning section.

Fixes: 9703d69d9d15 ("f2fs: support file pinning for zoned devices")
Signed-off-by: Daeho Jeong <daehojeong@google.com>
---
 fs/f2fs/segment.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 4fd76e867e0a..6474b7338e81 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -3559,6 +3559,8 @@ int f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
 	if (segment_full) {
 		if (type == CURSEG_COLD_DATA_PINNED &&
 		    !((curseg->segno + 1) % sbi->segs_per_sec)) {
+			write_sum_page(sbi, curseg->sum_blk,
+					GET_SUM_BLOCK(sbi, curseg->segno));
 			reset_curseg_fields(curseg);
 			goto skip_new_segment;
 		}
-- 
2.44.0.478.gd926399ef9-goog
Re: [f2fs-dev] [PATCH] f2fs: write missing last sum blk of file pinning section
Posted by Chao Yu 1 year, 10 months ago
On 2024/4/10 7:34, Daeho Jeong wrote:
> From: Daeho Jeong <daehojeong@google.com>
> 
> While do not allocating a new section in advance for file pinning area, I
> missed that we should write the sum block for the last segment of a file
> pinning section.
> 
> Fixes: 9703d69d9d15 ("f2fs: support file pinning for zoned devices")
> Signed-off-by: Daeho Jeong <daehojeong@google.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,