Re: [f2fs-dev] [PATCH 03/14] f2fs: support regular file buffered writes
From: Nanzhe Zhao
Date: Mon Sep 07 2026 - 08:11:39 EST
On Thu, 27 Aug 2026 16:56:53 +0800, Chao Yu wrote:
> Can we check this out of f2fs_ffs_test_blk_uptodate()? and add a sanity
> check here:
>
> f2fs_bug_on(sbi, !folio_contains(folio, index));
Thanks for the review. I'll move the check to the entry of the function
and turn it into a f2fs_bug_on() sanity assertion like this:
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
@@ f2fs_ffs_test_blk_uptodate() :
bool f2fs_ffs_test_blk_uptodate(const struct folio *folio, pgoff_t index)
{
struct f2fs_folio_state *ffs;
unsigned int idx;
+ f2fs_bug_on(F2FS_F_SB(folio), !folio_contains(folio, index));
+
if (!f2fs_folio_has_ffs(folio))
return folio_test_uptodate(folio);
- if (!folio_contains(folio, index))
- return false;
-
ffs = (struct f2fs_folio_state *)folio->private;
idx = index - folio->index;
return test_bit(idx, ffs->state);
}
Does it looks good to you?
Thanks,
Nanzhe