f2fs: write missing last sum blk of file pinning section
authorDaeho Jeong <daehojeong@google.com>
Tue, 9 Apr 2024 23:34:11 +0000 (16:34 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 12 Apr 2024 20:58:35 +0000 (20:58 +0000)
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>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/segment.c

index 4fd76e867e0a2efa772fda10e9f01a870c2edcd2..6474b7338e8112ef17dd01c11779877dd60a7cc8 100644 (file)
@@ -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;
                }