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
commit 091a4df upstream.

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
chaseyu authored and gregkh committed Jan 10, 2024
1 parent 397f719 commit 87318b7
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 @@ -615,7 +615,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 87318b7

Please sign in to comment.