[1/6] f2fs: fix to tag gcing flag on page during block migration
Commit Message
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 2d1fe8a86bf5 ("f2fs: fix to tag
gcing flag on page during file defragment").
Signed-off-by: Chao Yu <chao@kernel.org>
---
fs/f2fs/compress.c | 4 +++-
fs/f2fs/file.c | 2 ++
2 files changed, 5 insertions(+), 1 deletion(-)
Comments
Hello:
This series was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:
On Sun, 10 Dec 2023 19:35:42 +0800 you wrote:
> 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 2d1fe8a86bf5 ("f2fs: fix to tag
> gcing flag on page during file defragment").
>
> [...]
Here is the summary with links:
- [f2fs-dev,1/6] f2fs: fix to tag gcing flag on page during block migration
https://git.kernel.org/jaegeuk/f2fs/c/4961acdd65c9
- [f2fs-dev,2/6] f2fs: fix to wait on block writeback for post_read case
https://git.kernel.org/jaegeuk/f2fs/c/55fdc1c24a1d
- [f2fs-dev,3/6] f2fs: fix to check compress file in f2fs_move_file_range()
https://git.kernel.org/jaegeuk/f2fs/c/fb9b65340c81
- [f2fs-dev,4/6] f2fs: don't set FI_PREALLOCATED_ALL for partial write
(no matching commit)
- [f2fs-dev,5/6] f2fs: fix to restrict condition of compress inode conversion
(no matching commit)
- [f2fs-dev,6/6] f2fs: fix to update iostat correctly in f2fs_filemap_fault()
https://git.kernel.org/jaegeuk/f2fs/c/bb34cc6ca87f
You are awesome, thank you!
@@ -1036,8 +1036,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,
@@ -1312,6 +1312,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);
@@ -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);
set_page_dirty(page);
+ set_page_private_gcing(page);
f2fs_put_page(page, 1);
f2fs_put_page(page, 0);
}