lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aKg4PcgUCvXblVCY@mozart.vkv.me>
Date: Fri, 22 Aug 2025 02:28:29 -0700
From: Calvin Owens <calvin@...nvd.org>
To: Qu Wenruo <quwenruo.btrfs@....com>
Cc: linux-kernel@...r.kernel.org, linux-btrfs@...r.kernel.org,
	Daniel Vacek <neelx@...e.com>, David Sterba <dsterba@...e.com>,
	Josef Bacik <josef@...icpanda.com>, Chris Mason <clm@...com>
Subject: Re: [PATCH] btrfs: Accept and ignore compression level for lzo

On Friday 08/22 at 17:57 +0930, Qu Wenruo wrote:
> 在 2025/8/22 17:15, Calvin Owens 写道:
> > The compression level is meaningless for lzo, but before commit
> > 3f093ccb95f30 ("btrfs: harden parsing of compression mount options"),
> > it was silently ignored if passed.
> 
> Since LZO doesn't support compression level, why providing a level parameter
> in the first place?

Interpreting "no level" as "level is always one" doesn't seem that
unreasonable to me, especially since it has worked forever.

> I think it's time for those users to properly update their mount options.

It's a user visable regression, and fixing it has zero possible
downside. I think you should take my patch :)

Thanks,
Calvin

> > 
> > After that commit, passing a level with lzo fails to mount:
> > 
> >      BTRFS error: unrecognized compression value lzo:1
> > 
> > Restore the old behavior, in case any users were relying on it.
> > 
> > Fixes: 3f093ccb95f30 ("btrfs: harden parsing of compression mount options")
> > Signed-off-by: Calvin Owens <calvin@...nvd.org>
> > ---
> >   fs/btrfs/super.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> > index a262b494a89f..7ee35038c7fb 100644
> > --- a/fs/btrfs/super.c
> > +++ b/fs/btrfs/super.c
> > @@ -299,7 +299,7 @@ static int btrfs_parse_compress(struct btrfs_fs_context *ctx,
> >   		btrfs_set_opt(ctx->mount_opt, COMPRESS);
> >   		btrfs_clear_opt(ctx->mount_opt, NODATACOW);
> >   		btrfs_clear_opt(ctx->mount_opt, NODATASUM);
> > -	} else if (btrfs_match_compress_type(string, "lzo", false)) {
> > +	} else if (btrfs_match_compress_type(string, "lzo", true)) {
> >   		ctx->compress_type = BTRFS_COMPRESS_LZO;
> >   		ctx->compress_level = 0;
> >   		btrfs_set_opt(ctx->mount_opt, COMPRESS);
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ