From: Daeho Jeong <daehojeong@xxxxxxxxxx> commit b084403cfc3295b59a1b6bcc94efaf870fc3c2c9 upstream. 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@xxxxxxxxxx> Reviewed-by: Chao Yu <chao@xxxxxxxxxx> Signed-off-by: Jaegeuk Kim <jaegeuk@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/f2fs/segment.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -3479,8 +3479,11 @@ void f2fs_allocate_data_block(struct f2f */ if (segment_full) { if (type == CURSEG_COLD_DATA_PINNED && - !((curseg->segno + 1) % sbi->segs_per_sec)) + !((curseg->segno + 1) % sbi->segs_per_sec)) { + write_sum_page(sbi, curseg->sum_blk, + GET_SUM_BLOCK(sbi, curseg->segno)); goto skip_new_segment; + } if (from_gc) { get_atssr_segment(sbi, type, se->type, Patches currently in stable-queue which might be from daehojeong@xxxxxxxxxx are queue-6.6/f2fs-separate-f2fs_gc_range-to-use-gc-for-a-range.patch queue-6.6/f2fs-deprecate-io_bits.patch queue-6.6/f2fs-use-blks_per_seg-blks_per_sec-and-segs_per_sec.patch queue-6.6/f2fs-support-file-pinning-for-zoned-devices.patch queue-6.6/f2fs-kill-heap-based-allocation.patch queue-6.6/f2fs-write-missing-last-sum-blk-of-file-pinning-section.patch