summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorYangtao Li <frank.li@vivo.com>2023-01-23 12:46:01 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-11 15:55:18 +0300
commite11707d5f86fe1b507b1c2d70258df7c2661454e (patch)
treedcb65f5f1e150aad42944c3b1c3d0809ead20022 /fs/f2fs
parent05006a1521d8b5d4f87919942bf1180070cbc4ff (diff)
downloadlinux-e11707d5f86fe1b507b1c2d70258df7c2661454e.tar.xz
f2fs: allow set compression option of files without blocks
[ Upstream commit e6261beb0c629403dc58997294dd521bd23664af ] Files created by truncate have a size but no blocks, so they can be allowed to set compression option. Fixes: e1e8debec656 ("f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl") Signed-off-by: Yangtao Li <frank.li@vivo.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 7bb0c05e943c..88eecd7149cd 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -3937,7 +3937,7 @@ static int f2fs_ioc_set_compress_option(struct file *filp, unsigned long arg)
goto out;
}
- if (inode->i_size != 0) {
+ if (F2FS_HAS_BLOCKS(inode)) {
ret = -EFBIG;
goto out;
}