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

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>
---
v4:
- 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 b99d9cdf9ba7..be319a2e9830 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



_______________________________________________
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] 8+ messages in thread

end of thread, other threads:[~2026-08-11  7:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-09  1:19 [f2fs-dev] [PATCH v4 1/2] f2fs: fix to off-by-one issue in f2fs_zero_post_eof_page() Chao Yu via Linux-f2fs-devel
2026-08-09  1:19 ` Chao Yu
2026-08-09  1:19 ` [f2fs-dev] [PATCH v4 2/2] f2fs: fix to zero post-EOF data when extending file size Chao Yu via Linux-f2fs-devel
2026-08-09  1:19   ` Chao Yu
2026-08-10  8:52   ` [f2fs-dev] " Zhiguo Niu
2026-08-10  8:52     ` Zhiguo Niu
2026-08-11  7:17     ` Chao Yu via Linux-f2fs-devel
2026-08-11  7:17       ` Chao Yu

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.