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
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 <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
  • Loading branch information
chaseyu authored and asuka-mio committed Sep 20, 2023
1 parent 63d507e commit 2a9e981
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 @@ -588,7 +588,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 2a9e981

Please sign in to comment.