]> git.hungrycats.org Git - linux/commit
f2fs: reject setattr size changes on large folio files
authorWenjie Qi <qwjhust@gmail.com>
Wed, 10 Jun 2026 14:37:35 +0000 (22:37 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 22 Jun 2026 19:52:37 +0000 (19:52 +0000)
commit242d30bfc0a84b8b5de0a88821b53c9ad7fd31c4
treebabf1718964e4d15cd04272d2342125d70acd536
parent90e02a8e1b6863c41876473f844c8e24b06d55f7
f2fs: reject setattr size changes on large folio files

F2FS large folios are only enabled for immutable non-compressed files.
Writable open and writable mmap reject such mappings, but truncate(2)
through f2fs_setattr() misses the same guard.

If FS_IMMUTABLE_FL is cleared while the inode is still cached, the mapping
can keep large-folio support and ATTR_SIZE can change i_size. Reject size
changes in that state.

Cc: stable@kernel.org
Fixes: 05e65c14ea59 ("f2fs: support large folio for immutable non-compressed case")
Signed-off-by: Wenjie Qi <qiwenjie@xiaomi.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c