All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 1/2] f2fs: fix to off-by-one issue in f2fs_zero_post_eof_page()
@ 2026-08-11  7:16 ` Chao Yu via Linux-f2fs-devel
  0 siblings, 0 replies; 6+ messages in thread
From: Chao Yu @ 2026-08-11  7:16 UTC (permalink / raw)
  To: jaegeuk; +Cc: linux-f2fs-devel, linux-kernel, Chao Yu, stable

Otherwise, it will drop one more page after new_size which is not
necessary.

Cc: stable@kernel.org
Fixes: ba8dac350faf ("f2fs: fix to zero post-eof page")
Signed-off-by: Chao Yu <chao@kernel.org>
---
v5:
- no changes
 fs/f2fs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 56529a82e027..9dbe509926b2 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -50,7 +50,7 @@ static void f2fs_zero_post_eof_page(struct inode *inode,
 	if (lock)
 		filemap_invalidate_lock(inode->i_mapping);
 	/* zero or drop pages only in range of [old_size, new_size] */
-	truncate_inode_pages_range(inode->i_mapping, old_size, new_size);
+	truncate_inode_pages_range(inode->i_mapping, old_size, new_size - 1);
 	if (lock)
 		filemap_invalidate_unlock(inode->i_mapping);
 }
-- 
2.49.0


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

end of thread, other threads:[~2026-08-12 20:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-11  7:16 [PATCH v5 1/2] f2fs: fix to off-by-one issue in f2fs_zero_post_eof_page() Chao Yu
2026-08-11  7:16 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-08-11  7:16 ` [PATCH v5 2/2] f2fs: fix to zero post-EOF data when extending file size Chao Yu
2026-08-11  7:16   ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-08-12 20:30 ` [f2fs-dev] [PATCH v5 1/2] f2fs: fix to off-by-one issue in f2fs_zero_post_eof_page() patchwork-bot+f2fs--- via Linux-f2fs-devel
2026-08-12 20:30   ` patchwork-bot+f2fs

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.