Skip to content

Clarification about compression level support via btrfs property #1076

@emanuc

Description

@emanuc

Is it supported to configure the compression level via btrfs property?
(It seems so, at least based on this comment.)
I am not sure whether this is a documentation gap or whether the functionality is not fully implemented.

Inode properties

compression

compression algorithm set for an inode (it’s not possible to set the compression level this way), possible values:

https://btrfs.readthedocs.io/en/latest/btrfs-property.html#inode-properties

When trying to set the property, any parameter seems to be accepted without validation.

As far as I know, negative zstd compression levels are supported only down to -15. Is that correct?

emanu@fedora ~> sudo btrfs property set Scaricati compression zstd:-15
emanu@fedora ~ [1]> sudo btrfs property get Scaricati
compression=zstd:-15

emanu@fedora ~> sudo btrfs property set Scaricati compression zstd:-150
emanu@fedora ~> sudo btrfs property get Scaricati
compression=zstd:-150

If so, when running btrfs property get, it should not display an unsupported compression level.
What is the expected behavior in this case?

Does Btrfs actually apply the nearest supported level (for example -15)?

Or is the property silently ignored when an unsupported value is set?

Clarifying this behavior (and documenting it) would be very helpful.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsChanges in documentation or help text

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions