Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5684475rwd; Mon, 12 Jun 2023 08:19:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5RGQKKGG0+LHtvoKu6sRXmghkkyPVcsYwqMyBgHRKUfUUCKmoW1Y3Sgrd8zvnddt+ojjXG X-Received: by 2002:a17:907:7e97:b0:981:82c0:15bb with SMTP id qb23-20020a1709077e9700b0098182c015bbmr3773809ejc.0.1686583176078; Mon, 12 Jun 2023 08:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686583176; cv=none; d=google.com; s=arc-20160816; b=xI37MZnufB7UVx1R28AtGPmHUv+pcX9PBH/CLNgI1tC7wdPRHH03gcFvY3SxI0wsA6 xNB+8ticBDgyJbp7X0NdIPCyTtw9df4/1DQ25SIM5kBkfoi0s3yMhPgCXGdx8rAN8DQ5 IOBQfJb6YSjJMBb1vNByFkclRLHlog2tYOvt0PnrRQP3rmcODvS29X3zRd9ACK60Jl8M hl3U6RUWGqDGKfly015fsWXmHAKErTdGZ8IaTVhExW7aFoOcTH7AKqLzAR7lS0Nio3RK I8ndL8npiGvKoVWuvyvavDETOa6fb0ymLeFAZ9LEY8MnwWkR/EkDEKdv/2n1ebhY1zLm XLOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=kW8uey/xp0eGxvK/6N16Sn8FYmDkQAw++OHXUiK84wI=; b=gdw0vcHFcnztB3f7yjHOqW93MDuvCZwDrlLuuMmRD3aH8jxJ4U+zU8Xhh3vwgH9xZH u5sncRarnrB4RV9lMIGGjRIOS5OBXm4d9G23UN6XeuPZzRc4JyLmiYRz7AYdI6G9uVC9 KyjYpipvtlm76X8Q12f4sVMLpi/Z8GG2BFHcuWNH/VejHf/xuTVYgEtVtaHthz2hkpsm xEGSZEZZWY87NaBoB0z8dNLA2AGKJ2w79BJ/obCAynQxp7OPshEpIE0gPLPZr4KXIEMr WCfXu2AnCwG+ddKIyqf2QTT4OhUAgeqf1reDGUEok4vpQKA5iYWfPSbHcqeN3pHfPHz8 tKBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Zi10AnLs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s13-20020a170906c30d00b0096a1843be21si5297171ejz.599.2023.06.12.08.19.10; Mon, 12 Jun 2023 08:19:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Zi10AnLs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237249AbjFLO0m (ORCPT + 99 others); Mon, 12 Jun 2023 10:26:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238836AbjFLO0K (ORCPT ); Mon, 12 Jun 2023 10:26:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 101392953 for ; Mon, 12 Jun 2023 07:24:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CA3EA615E3 for ; Mon, 12 Jun 2023 14:23:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6656BC433EF; Mon, 12 Jun 2023 14:23:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686579835; bh=ru8p5cn4S9smhGWMCMzJZMSU8wN0AsEFLROWReLGgxo=; h=Date:Subject:To:References:From:In-Reply-To:From; b=Zi10AnLsRmaE0mjSsNlAG/fSkLrflx62UQ/GzGd9nU7h/uA79ZGYUdUYMLq424JvQ wZX4JYP4GJCiTXF31768h3v4WcuYwEaEL3alc0q9ZNMI6Uh5Zc7Sg88IHjioBN7eL/ 7JgQcAZncEbZ2JtZWLq2a6fio1j1hgSYG13d3GJWiol+U8G98Y4A9d/BqLZp8wwfJc YW7i10sRtp9FkwptmMjfyXEGdjEbpbCsSAsPFwznbPRm9X6iKZbC1YyVAr+btAW+n8 EZzWpu8rkYLrj7vU6+AbmbGUy/ZgPPKjZmdpYjrWDmW1gYH2eASiADT2rGz7V2jPnU tpR+KfJ0thnCg== Message-ID: <85ff67e0-c6c6-e693-bcba-6e36a3dd2ea4@kernel.org> Date: Mon, 12 Jun 2023 22:23:52 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [f2fs-dev] [PATCH] f2fs: set zstd default compression level to 3 Content-Language: en-US To: Jaegeuk Kim , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net References: <20230607162954.2651657-1-jaegeuk@kernel.org> From: Chao Yu In-Reply-To: <20230607162954.2651657-1-jaegeuk@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/6/8 0:29, Jaegeuk Kim wrote: > 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, > > The commit d7ffafc99c42 ("f2fs: add sanity compress level check for compressed file") > revealed the issue. > > Signed-off-by: Jaegeuk Kim > --- > fs/f2fs/super.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > index 8fd23caa1ed9..1fb8d4f27a40 100644 > --- a/fs/f2fs/super.c > +++ b/fs/f2fs/super.c > @@ -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; > } >