Skip to content

Commit 8c2d150

Browse files
chaseyugregkh
authored andcommitted
f2fs: compress: fix to set zstd compress level correctly
[ Upstream commit 01f6afd ] As 5kft reported in [1]: set_compress_context() should set compress level into .i_compress_flag for zstd as well as lz4hc, otherwise, zstd compressor will still use default zstd compress level during compression, fix it. [1] https://lore.kernel.org/linux-f2fs-devel/[email protected]/T/#u Fixes: 3fde13f ("f2fs: compress: support compress level") Reported-by: 5kft <[email protected]> Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent bf7fc09 commit 8c2d150

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/f2fs/f2fs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4020,7 +4020,8 @@ static inline void set_compress_context(struct inode *inode)
40204020
1 << COMPRESS_CHKSUM : 0;
40214021
F2FS_I(inode)->i_cluster_size =
40224022
1 << F2FS_I(inode)->i_log_cluster_size;
4023-
if (F2FS_I(inode)->i_compress_algorithm == COMPRESS_LZ4 &&
4023+
if ((F2FS_I(inode)->i_compress_algorithm == COMPRESS_LZ4 ||
4024+
F2FS_I(inode)->i_compress_algorithm == COMPRESS_ZSTD) &&
40244025
F2FS_OPTION(sbi).compress_level)
40254026
F2FS_I(inode)->i_compress_flag |=
40264027
F2FS_OPTION(sbi).compress_level <<

0 commit comments

Comments
 (0)