linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH 1/6] f2fs: fix to tag gcing flag on page during block migration
@ 2023-12-10 11:35 Chao Yu
  2023-12-10 11:35 ` [f2fs-dev] [PATCH 2/6] f2fs: fix to wait on block writeback for post_read case Chao Yu
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Chao Yu @ 2023-12-10 11:35 UTC (permalink / raw)
  To: jaegeuk; +Cc: linux-kernel, linux-f2fs-devel

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(-)

diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
index b35be5799726..c5a4364c4482 100644
--- a/fs/f2fs/compress.c
+++ b/fs/f2fs/compress.c
@@ -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,
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 60290940018d..156b0ff05a3b 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -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);
 	}
-- 
2.40.1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-01-11  3:07 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-10 11:35 [f2fs-dev] [PATCH 1/6] f2fs: fix to tag gcing flag on page during block migration Chao Yu
2023-12-10 11:35 ` [f2fs-dev] [PATCH 2/6] f2fs: fix to wait on block writeback for post_read case Chao Yu
2023-12-10 11:35 ` [f2fs-dev] [PATCH 3/6] f2fs: fix to check compress file in f2fs_move_file_range() Chao Yu
2023-12-10 11:35 ` [f2fs-dev] [PATCH 4/6] f2fs: don't set FI_PREALLOCATED_ALL for partial write Chao Yu
2023-12-11 22:08   ` Jaegeuk Kim
2023-12-10 11:35 ` [f2fs-dev] [PATCH 5/6] f2fs: fix to restrict condition of compress inode conversion Chao Yu
2023-12-11 22:11   ` Jaegeuk Kim
2023-12-12  1:05     ` Chao Yu
2023-12-12 22:21       ` Jaegeuk Kim
2023-12-28 15:33         ` Chao Yu
2024-01-02 22:54           ` Jaegeuk Kim
2024-01-11  3:07             ` Chao Yu
2023-12-10 11:35 ` [f2fs-dev] [PATCH 6/6] f2fs: fix to update iostat correctly in f2fs_filemap_fault() Chao Yu
2023-12-14 20:50 ` [f2fs-dev] [PATCH 1/6] f2fs: fix to tag gcing flag on page during block migration patchwork-bot+f2fs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).