From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39951FA3740 for ; Thu, 27 Oct 2022 14:32:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234763AbiJ0Oci convert rfc822-to-8bit (ORCPT ); Thu, 27 Oct 2022 10:32:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233548AbiJ0Och (ORCPT ); Thu, 27 Oct 2022 10:32:37 -0400 Received: from drax.kayaks.hungrycats.org (drax.kayaks.hungrycats.org [174.142.148.226]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7D695D25A0 for ; Thu, 27 Oct 2022 07:32:36 -0700 (PDT) Received: by drax.kayaks.hungrycats.org (Postfix, from userid 1002) id AF3E35BD690; Thu, 27 Oct 2022 10:32:33 -0400 (EDT) Date: Thu, 27 Oct 2022 10:32:25 -0400 From: Zygo Blaxell To: Chris Murphy Cc: Nemcev Aleksey , Btrfs BTRFS Subject: Re: compsize reports that filesystem uses zlib compression, while I set zstd compression everywhere Message-ID: References: <3c352b84-c52a-9e01-1ace-6e984e167753@inbox.ru> <0f6f1ecb-84d4-4fac-9fcc-5932d5b4f73d@app.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <0f6f1ecb-84d4-4fac-9fcc-5932d5b4f73d@app.fastmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Thu, Oct 27, 2022 at 09:21:53AM -0400, Chris Murphy wrote: > > > On Wed, Oct 26, 2022, at 9:03 PM, Zygo Blaxell wrote: > > >> And also it's not possible to specify compression level in defragment - so, > >> I'll change the level in subvolume properties, defragment with -czstd, and > >> change the level back. > > > > It's not possible to set the level in subvol properties either. Only the > > compress= mount option can set the level. > > $ sudo btrfs property set test compression zstd:1 > $ sudo btrfs property get test > compression=zstd:1 > $ sudo btrfs property set test compression zstd:f > $ sudo btrfs property get test > compression=zstd:f > > It's allowing the arbitrary setting of compression values. This is with > btrfs-progs 6.0. Progs is being too permissive, it shouldn't silently > set invalid values. But then even with valid values, I'm pretty sure > right now the kernel ignores the compression properties. Correct. You can put whatever you want in the string, but the kernel only ever looks at fs_info for compress_level, which is set from the mount options. e.g. if you mount with 'compress=zlib:5' and you have a file with btrfs.compression property with 'zstd:7', what you get is zstd compression with level 5. > -- > Chris Murphy >