Re: [f2fs-dev] [PATCH 05/14] f2fs: support large folio writeback
From: Nanzhe Zhao
Date: Sun Sep 06 2026 - 23:58:27 EST
On Thu, 27 Aug 2026 19:17:33 +0800, Chao Yu wrote:
> We should not relocate dec_page_count() above f2fs_in_warm_node_list() to
> avoid racing bugs.
Thanks for the review, I'll restore the order like this:
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
@@ f2fs_write_end_bio()
- if (f2fs_folio_has_ffs(folio)) {
- struct f2fs_folio_state *ffs =
- (struct f2fs_folio_state *)folio->private;
-
- finished = atomic_sub_and_test(nr_pages,
- &ffs->write_pages_pending);
- }
-
- while (nr_pages--)
- dec_page_count(sbi, type);
-
if (f2fs_in_warm_node_list(folio))
f2fs_del_fsync_node_entry(sbi, folio);
+ if (f2fs_folio_has_ffs(folio)) {
+ struct f2fs_folio_state *ffs =
+ (struct f2fs_folio_state *)folio->private;
+
+ finished = atomic_sub_and_test(nr_pages,
+ &ffs->write_pages_pending);
+ }
+
+ while (nr_pages--)
+ dec_page_count(sbi, type);
+
/*
* we should access sbi before folio_end_writeback() to
* avoid racing w/ kill_f2fs_super()
*/
...
if (finished) {
folio_clear_f2fs_gcing(folio);
folio_end_writeback(folio);
}
Does this look good to you?
--
Nanzhe Zhao