diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2022-10-25 02:00:35 +0300 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2022-11-02 03:56:03 +0300 |
commit | a995627e6dd81d4485d40ce64880017a080d71e6 (patch) | |
tree | 772479eee8a59062af7255f23cb5f616093e3038 /fs/f2fs/file.c | |
parent | 6047de5482c33d5f912cdc907336fde9ebc5714e (diff) | |
download | linux-a995627e6dd81d4485d40ce64880017a080d71e6.tar.xz |
f2fs: allow to set compression for inlined file
The below commit disallows to set compression on empty created file which
has a inline_data. Let's fix it.
Fixes: 7165841d578e ("f2fs: fix to check inline_data during compressed inode conversion")
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 | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 82cda1258227..f96bbfa8b399 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1915,6 +1915,10 @@ static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask) if (!f2fs_disable_compressed_file(inode)) return -EINVAL; } else { + /* try to convert inline_data to support compression */ + int err = f2fs_convert_inline_inode(inode); + if (err) + return err; if (!f2fs_may_compress(inode)) return -EINVAL; if (S_ISREG(inode->i_mode) && F2FS_HAS_BLOCKS(inode)) |