f2fs: set zstd compress level correctly

Message ID 20221117151054.2232946-1-shengyong@oppo.com
State New
Headers
Series f2fs: set zstd compress level correctly |

Commit Message

Sheng Yong Nov. 17, 2022, 3:10 p.m. UTC
  Fixes: cf30f6a5f0c6 ("lib: zstd: Add kernel-specific API")
Signed-off-by: Sheng Yong <shengyong@oppo.com>
---
 fs/f2fs/compress.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Nick Terrell Nov. 24, 2022, 12:55 a.m. UTC | #1
> On Nov 17, 2022, at 7:10 AM, Sheng Yong <shengyong@oppo.com> wrote:
> 
> > 
> Fixes: cf30f6a5f0c6 ("lib: zstd: Add kernel-specific API")
> Signed-off-by: Sheng Yong <shengyong@oppo.com>
> ---
> fs/f2fs/compress.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
> index d315c2de136f2..74d3f2d2271f3 100644
> --- a/fs/f2fs/compress.c
> +++ b/fs/f2fs/compress.c
> @@ -346,7 +346,7 @@ static int zstd_init_compress_ctx(struct compress_ctx *cc)
> 	if (!level)
> 		level = F2FS_ZSTD_DEFAULT_CLEVEL;
> 
> -	params = zstd_get_params(F2FS_ZSTD_DEFAULT_CLEVEL, cc->rlen);
> +	params = zstd_get_params(level, cc->rlen);
> 	workspace_size = zstd_cstream_workspace_bound(&params.cParams);
> 
> 	workspace = f2fs_kvmalloc(F2FS_I_SB(cc->inode),
> -- 
> 2.25.1
> 

Thanks for the patch, and sorry for introducing the bug!
Looks like I missed this while rebasing that patch series.

Reviewed-by: Nick Terrell <terrelln@fb.com>
  
Chao Yu Nov. 24, 2022, 3:11 p.m. UTC | #2
On 2022/11/17 23:10, Sheng Yong wrote:
> Fixes: cf30f6a5f0c6 ("lib: zstd: Add kernel-specific API")
> Signed-off-by: Sheng Yong <shengyong@oppo.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,
  

Patch

diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
index d315c2de136f2..74d3f2d2271f3 100644
--- a/fs/f2fs/compress.c
+++ b/fs/f2fs/compress.c
@@ -346,7 +346,7 @@  static int zstd_init_compress_ctx(struct compress_ctx *cc)
 	if (!level)
 		level = F2FS_ZSTD_DEFAULT_CLEVEL;
 
-	params = zstd_get_params(F2FS_ZSTD_DEFAULT_CLEVEL, cc->rlen);
+	params = zstd_get_params(level, cc->rlen);
 	workspace_size = zstd_cstream_workspace_bound(&params.cParams);
 
 	workspace = f2fs_kvmalloc(F2FS_I_SB(cc->inode),