]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
f2fs: set zstd compress level correctly
authorSheng Yong <shengyong@oppo.com>
Thu, 17 Nov 2022 15:10:54 +0000 (23:10 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:26:21 +0000 (13:26 +0100)
[ Upstream commit 4ff23a6547b81ca22adb852dfe93ee5fc45328ac ]

Fixes: cf30f6a5f0c6 ("lib: zstd: Add kernel-specific API")
Signed-off-by: Sheng Yong <shengyong@oppo.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Reviewed-by: Nick Terrell <terrelln@fb.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/compress.c

index 70e97075e535e53b7710ffe3a3c27116e2fc82c7..e70928e92b2cd990dac08e078dce1d538cda9db4 100644 (file)
@@ -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),