Commit 4961acdd authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

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 2d1fe8a8 ("f2fs: fix to tag
gcing flag on page during file defragment").
Signed-off-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 87f3afd3
...@@ -1036,8 +1036,10 @@ static void set_cluster_dirty(struct compress_ctx *cc) ...@@ -1036,8 +1036,10 @@ static void set_cluster_dirty(struct compress_ctx *cc)
int i; int i;
for (i = 0; i < cc->cluster_size; 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_dirty(cc->rpages[i]);
set_page_private_gcing(cc->rpages[i]);
}
} }
static int prepare_compress_overwrite(struct compress_ctx *cc, static int prepare_compress_overwrite(struct compress_ctx *cc,
......
...@@ -1312,6 +1312,7 @@ static int __clone_blkaddrs(struct inode *src_inode, struct inode *dst_inode, ...@@ -1312,6 +1312,7 @@ static int __clone_blkaddrs(struct inode *src_inode, struct inode *dst_inode,
} }
memcpy_page(pdst, 0, psrc, 0, PAGE_SIZE); memcpy_page(pdst, 0, psrc, 0, PAGE_SIZE);
set_page_dirty(pdst); set_page_dirty(pdst);
set_page_private_gcing(pdst);
f2fs_put_page(pdst, 1); f2fs_put_page(pdst, 1);
f2fs_put_page(psrc, 1); f2fs_put_page(psrc, 1);
...@@ -4046,6 +4047,7 @@ static int redirty_blocks(struct inode *inode, pgoff_t page_idx, int len) ...@@ -4046,6 +4047,7 @@ static int redirty_blocks(struct inode *inode, pgoff_t page_idx, int len)
f2fs_bug_on(F2FS_I_SB(inode), !page); f2fs_bug_on(F2FS_I_SB(inode), !page);
set_page_dirty(page); set_page_dirty(page);
set_page_private_gcing(page);
f2fs_put_page(page, 1); f2fs_put_page(page, 1);
f2fs_put_page(page, 0); f2fs_put_page(page, 0);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment