f2fs: set zstd default compression level to 3
Jaegeuk Kim
maintainerPATCH 1/1 f2fs: set zstd default compression level to 3
ZSTD does not support compress_level=0.
The commit d7ffafc99c42 ("f2fs: add sanity compress level check for compressed file") revealed the issue.
--- fs/f2fs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/super.c +1 -1
@@ -627,7 +627,7 @@ static int f2fs_set_zstd_level(struct f2fs_sb_info *sbi, const char *str)int len =4 ;if (strlen (str) == len) { -F2FS_OPTION (sbi).compress_level =0 ; +F2FS_OPTION (sbi).compress_level =3 ;return 0 ; }
Signature · 8 lines
2.41.0.rc0.172.g3f132b7071-goog _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Chao Yu
maintainerQuoted 1 line · Jaegeuk Kim
ZSTD does not support compress_level=0.
IIUC, it looks the range is [0, ZSTD_MAX_CLEVEL], 0 equals to default (ZSTD_CLEVEL_DEFAULT).
zstd_compress.c
/* row */
if (compressionLevel == 0) row = ZSTD_CLEVEL_DEFAULT; /* 0 == default */
else if (compressionLevel < 0) row = 0; /* entry 0 is baseline for fast mode */
else if (compressionLevel > ZSTD_MAX_CLEVEL) row = ZSTD_MAX_CLEVEL;
else row = compressionLevel;Thanks,
Quoted 14 lines
The commit
d7ffafc99c42("f2fs: add sanity compress level check for compressed file") revealed the issue.Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/f2fs/super.c +0
-0
fs/f2fs/super.c static int f2fs_set_zstd_level(struct f2fs_sb_info *sbi, const char *str) · line 633
Quoted 8 lines
fs/f2fs/super.c +1
-1@@ -627,7 +627,7 @@ static int f2fs_set_zstd_level(struct f2fs_sb_info *sbi, const char *str)int len =4 ;if (strlen (str) == len) { -F2FS_OPTION (sbi).compress_level =0 ; +F2FS_OPTION (sbi).compress_level =3 ;return 0 ; }
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Jaegeuk Kim
maintainerQuoted 5 lines · Chao Yu
Quoted 1 line · Jaegeuk Kim
ZSTD does not support compress_level=0.
IIUC, it looks the range is [0,
ZSTD_MAX_CLEVEL], 0 equals to default (ZSTD_CLEVEL_DEFAULT).
Ok, that seems a quick workaround of zstd, since it'd be quite hard to know level=0 will be interpreted to whatever default behind the scenes.
Quoted 20 lines
zstd_compress.c/* row */ if (compressionLevel == 0) row = ZSTD_CLEVEL_DEFAULT; /* 0 == default */ else if (compressionLevel < 0) row = 0; /* entry 0 is baseline for fast mode */ else if (compressionLevel > ZSTD_MAX_CLEVEL) row = ZSTD_MAX_CLEVEL; else row = compressionLevel;Thanks,
Quoted 9 lines
The commit
d7ffafc99c42("f2fs: add sanity compress level check for compressed file") revealed the issue.Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 11 lines
fs/f2fs/super.c static int f2fs_set_zstd_level(struct f2fs_sb_info *sbi, const char *str) · line 631
Quoted 11 lines
fs/f2fs/super.c +1
-1@@ -627,7 +627,7 @@ static int f2fs_set_zstd_level(struct f2fs_sb_info *sbi, const char *str)int len =4 ;if (strlen (str) == len) { -F2FS_OPTION (sbi).compress_level =0 ; +F2FS_OPTION (sbi).compress_level =3 ;return 0 ; }
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Jaegeuk Kim
maintainerPATCH 1/1 f2fs: set zstd default compression level to ZSTD_CLEVEL_DEFAULT
In reply to Jaegeuk KimZSTD does not support compress_level=0.
The commit d7ffafc99c42 ("f2fs: add sanity compress level check for compressed file") started to complain this.
---
Change log from v1:
- use default macro
fs/f2fs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/super.c +1 -1
@@ -627,7 +627,7 @@ static int f2fs_set_zstd_level(struct f2fs_sb_info *sbi, const char *str)int len =4 ;if (strlen (str) == len) { -F2FS_OPTION (sbi).compress_level =0 ; +F2FS_OPTION (sbi).compress_level =ZSTD_CLEVEL_DEFAULT ;return 0 ; }
Signature · 8 lines
2.41.0.162.gfafddb0af9-goog _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Re: [f2fs-dev] [PATCH] f2fs: set zstd default compression level to ZSTD_CLEVEL_DEFAULT
Quoted 6 lines · Jaegeuk Kim
ZSTD does not support compress_level=0.
The commit
d7ffafc99c42("f2fs: add sanity compress level check for compressed file") started to complain this.Signed-off-by Jaegeuk Kim <[email protected]>
Thanks,
Jaegeuk Kim
maintainerRe: [f2fs-dev] [PATCH] f2fs: set zstd default compression level to ZSTD_CLEVEL_DEFAULT
Quoted 9 lines · Chao Yu
Quoted 6 lines · Jaegeuk Kim
ZSTD does not support compress_level=0.
The commit
d7ffafc99c42("f2fs: add sanity compress level check for compressed file") started to complain this.Signed-off-by Jaegeuk Kim <[email protected]>Reviewed-by Chao Yu <[email protected]>
Quoted 2 lines
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel