Skip to content

Commit

Permalink
f2fs: compress: fix to assign compress_level for lz4 correctly
Browse files Browse the repository at this point in the history
[ Upstream commit 091a4df ]

After remount, F2FS_OPTION().compress_level was assgin to
LZ4HC_DEFAULT_CLEVEL incorrectly, result in lz4hc:9 was enabled, fix it.

1. mount /dev/vdb
/dev/vdb on /mnt/f2fs type f2fs (...,compress_algorithm=lz4,compress_log_size=2,...)
2. mount -t f2fs -o remount,compress_log_size=3 /mnt/f2fs/
3. mount|grep f2fs
/dev/vdb on /mnt/f2fs type f2fs (...,compress_algorithm=lz4:9,compress_log_size=3,...)

Fixes: 00e120b ("f2fs: assign default compression level")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Chao Yu authored and Greg Kroah-Hartman committed Sep 13, 2023
1 parent 825588e commit 497dd09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/f2fs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ static int f2fs_set_lz4hc_level(struct f2fs_sb_info *sbi, const char *str)
unsigned int level;

if (strlen(str) == 3) {
F2FS_OPTION(sbi).compress_level = LZ4HC_DEFAULT_CLEVEL;
F2FS_OPTION(sbi).compress_level = 0;
return 0;
}

Expand Down

0 comments on commit 497dd09

Please sign in to comment.