Re: [PATCH 14/14] f2fs: make compressed files compatible with large folio
From: Chao Yu
Date: Mon Aug 31 2026 - 05:31:21 EST
On 8/26/26 21:09, Nanzhe Zhao wrote:
The compression flag is the hint indicates that the inode can be
compressed, when the inode is using large folio, we expected it keeps
using the large folio read/write paths and its data stays uncompressed
on disk until the inode is evicted and re-read
Let f2fs_write_begin() skip the compression overwrite preparation for
such inodes and remove the compressed-file gate in
f2fs_read_data_large_folio() so the data is simply read/written as
regular blocks.
Can you please elaborate more about compress policy in doc as well?
Otherwise, user may be confuse about compressed inode behavior, e.g.
for the case we enable compress inode via ioctl, but due to large
folio flag is set, content of inode will be kept as raw before evict
and reload.
Thanks,
Signed-off-by: Nanzhe Zhao <zhaonanzhe@xxxxxxxxxx>
---
fs/f2fs/data.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 2e20833c6417..befcdc3742f6 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -2955,12 +2955,6 @@ static int f2fs_read_data_large_folio(struct inode *inode,
int ret = 0;
bool folio_in_bio = false;
- if (f2fs_compressed_file(inode)) {
- if (folio)
- folio_unlock(folio);
- return -EOPNOTSUPP;
- }
-
map.m_seg_type = NO_CHECK_TYPE;
if (rac)
@@ -4935,7 +4929,8 @@ static int f2fs_write_begin(const struct kiocb *iocb,
}
#ifdef CONFIG_F2FS_FS_COMPRESSION
- if (f2fs_compressed_file(inode)) {
+ if (f2fs_compressed_file(inode) &&
+ !mapping_large_folio_support(inode->i_mapping)) {
int ret;
struct page *page;