Skip to content

Commit 4961acd

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: fix to tag gcing flag on page during block migration
It needs to add missing gcing flag on page during block migration, in order to garantee migrated data be persisted during checkpoint, otherwise out-of-order persistency between data and node may cause data corruption after SPOR. Similar issue was fixed by commit 2d1fe8a ("f2fs: fix to tag gcing flag on page during file defragment"). Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent 87f3afd commit 4961acd

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

fs/f2fs/compress.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,8 +1036,10 @@ static void set_cluster_dirty(struct compress_ctx *cc)
10361036
int i;
10371037

10381038
for (i = 0; i < cc->cluster_size; i++)
1039-
if (cc->rpages[i])
1039+
if (cc->rpages[i]) {
10401040
set_page_dirty(cc->rpages[i]);
1041+
set_page_private_gcing(cc->rpages[i]);
1042+
}
10411043
}
10421044

10431045
static int prepare_compress_overwrite(struct compress_ctx *cc,

fs/f2fs/file.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,6 +1312,7 @@ static int __clone_blkaddrs(struct inode *src_inode, struct inode *dst_inode,
13121312
}
13131313
memcpy_page(pdst, 0, psrc, 0, PAGE_SIZE);
13141314
set_page_dirty(pdst);
1315+
set_page_private_gcing(pdst);
13151316
f2fs_put_page(pdst, 1);
13161317
f2fs_put_page(psrc, 1);
13171318

@@ -4046,6 +4047,7 @@ static int redirty_blocks(struct inode *inode, pgoff_t page_idx, int len)
40464047
f2fs_bug_on(F2FS_I_SB(inode), !page);
40474048

40484049
set_page_dirty(page);
4050+
set_page_private_gcing(page);
40494051
f2fs_put_page(page, 1);
40504052
f2fs_put_page(page, 0);
40514053
}

0 commit comments

Comments
 (0)