mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 21:33:52 +00:00
f2fs: fix to tag gcing flag on page during block migration
[ Upstream commit4961acdd65
] 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 commit2d1fe8a86b
("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
fb55c3cee6
commit
7c972c8945
2 changed files with 5 additions and 1 deletions
|
@ -1026,8 +1026,10 @@ static void set_cluster_dirty(struct compress_ctx *cc)
|
|||
int i;
|
||||
|
||||
for (i = 0; i < cc->cluster_size; i++)
|
||||
if (cc->rpages[i])
|
||||
if (cc->rpages[i]) {
|
||||
set_page_dirty(cc->rpages[i]);
|
||||
set_page_private_gcing(cc->rpages[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static int prepare_compress_overwrite(struct compress_ctx *cc,
|
||||
|
|
|
@ -1326,6 +1326,7 @@ static int __clone_blkaddrs(struct inode *src_inode, struct inode *dst_inode,
|
|||
}
|
||||
memcpy_page(pdst, 0, psrc, 0, PAGE_SIZE);
|
||||
set_page_dirty(pdst);
|
||||
set_page_private_gcing(pdst);
|
||||
f2fs_put_page(pdst, 1);
|
||||
f2fs_put_page(psrc, 1);
|
||||
|
||||
|
@ -4037,6 +4038,7 @@ static int redirty_blocks(struct inode *inode, pgoff_t page_idx, int len)
|
|||
f2fs_bug_on(F2FS_I_SB(inode), !page);
|
||||
|
||||
set_page_dirty(page);
|
||||
set_page_private_gcing(page);
|
||||
f2fs_put_page(page, 1);
|
||||
f2fs_put_page(page, 0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue