diff options
author | Yangtao Li <frank.li@vivo.com> | 2023-01-23 10:46:01 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2023-01-31 19:47:46 +0100 |
commit | e6261beb0c629403dc58997294dd521bd23664af (patch) | |
tree | 072b1166d5d643e251800eb108d8e734d60a4c9b /fs/f2fs/file.c | |
parent | f2fs: fix information leak in f2fs_move_inline_dirents() (diff) | |
download | linux-e6261beb0c629403dc58997294dd521bd23664af.tar.xz linux-e6261beb0c629403dc58997294dd521bd23664af.zip |
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: 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>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r-- | fs/f2fs/file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index f5c1b7814954..391da47761e3 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -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; } |