Commit e6261beb authored by Yangtao Li's avatar Yangtao Li Committed by Jaegeuk Kim

f2fs: allow set compression option of files without blocks

Files created by truncate have a size but no blocks, so
they can be allowed to set compression option.

Fixes: e1e8debe ("f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl")
Signed-off-by: default avatarYangtao Li <frank.li@vivo.com>
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 9a5571cf
......@@ -3941,7 +3941,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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment