From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>, stable@kernel.org
Subject: [PATCH] f2fs: do f2fs_zero_post_eof_page for all the time
Date: Wed, 28 Oct 2026 05:06:15 +0000 [thread overview]
Message-ID: <20261028050615.259268-1-jaegeuk@kernel.org> (raw)
This fixes xfstests/generic/794, since the issue is not related to the
posix=strict mode only.
Cc: stable@kernel.org
Fixes: 5eced87b7d19 ("f2fs: fix to zero post-EOF data when extending file size")
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fs/f2fs/file.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 8b4a7a9d7dbe..823df06ae0f2 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -74,15 +74,10 @@ static int f2fs_zero_post_eof_page(struct inode *inode,
loff_t new_size, bool lock, bool writeback)
{
loff_t old_size = i_size_read(inode);
- bool strict =
- F2FS_OPTION(F2FS_I_SB(inode)).fsync_mode == FSYNC_MODE_STRICT;
if (old_size >= new_size)
return 0;
- if (!strict && mapping_empty(inode->i_mapping))
- return 0;
-
if (lock)
filemap_invalidate_lock(inode->i_mapping);
/* zero or drop pages only in range of [old_size, new_size] */
@@ -90,14 +85,9 @@ static int f2fs_zero_post_eof_page(struct inode *inode,
if (lock)
filemap_invalidate_unlock(inode->i_mapping);
- if (!writeback || !strict)
+ if (!writeback)
return 0;
- /*
- * In fsync_mode=strict, when we expand an unaligned EOF size, we
- * should zero post EOF data and writeback the data immediately,
- * so that it can avoid exposing stale data after metadata flush
- * and POR.
- */
+
return do_zero_post_eof_page(inode, new_size);
}
--
2.56.0.307.g5fe7bd680c-goog
next reply other threads:[~2026-10-28 5:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 5:06 Jaegeuk Kim [this message]
2026-10-28 8:32 ` [f2fs-dev] " Chao Yu
2026-10-28 15:26 ` Jaegeuk Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261028050615.259268-1-jaegeuk@kernel.org \
--to=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®