summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaeho Jeong <daehojeong@google.com>2024-04-09 16:34:11 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-06-12 11:13:03 +0200
commit4647876e7e4e3a322330892684106972f085246b (patch)
tree6d9909209ff2b9c945841b58d7b14ab5065ae969
parent98ed486436a0e4c88cd1efd57b1008dd64baa769 (diff)
f2fs: write missing last sum blk of file pinning section
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@google.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/f2fs/segment.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index a29fdf30c584..916d5b3d6843 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -3479,8 +3479,11 @@ void 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))
+ !((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,