Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* Inline data is compressed unconditinally even when results in increased size
@ 2026-09-14 15:46 Hanabishi
  2026-09-14 17:46 ` Filipe Manana
  0 siblings, 1 reply; 3+ messages in thread
From: Hanabishi @ 2026-09-14 15:46 UTC (permalink / raw)
  To: linux-btrfs

Hello.

I noticed that a btrfs volume with compression enabled (e.g. 'compress=zstd') seems to compress inline data unconditionally, even in situations when compression is ineffective and only leads to increase in size.

It is easily reproducible on small files:

# echo 'a file with test content' > test.txt
# sync
# compsize test.txt
Processed 1 file, 0 regular extents (0 refs), 1 inline.
Type       Perc     Disk Usage   Uncompressed Referenced
TOTAL      172%       43B          25B          25B
zstd       172%       43B          25B          25B

Same file when no compression enabled:

Processed 1 file, 0 regular extents (0 refs), 1 inline.
Type       Perc     Disk Usage   Uncompressed Referenced
TOTAL      100%       25B          25B          25B
none       100%       25B          25B          25B

It's not a big deal on practice, but shouldn't it detect that the file is uncompressible and fall back to no compression?
Also, if I remember correctly, it wasn't the case a couple of kernel releases back.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-14 18:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-14 15:46 Inline data is compressed unconditinally even when results in increased size Hanabishi
2026-09-14 17:46 ` Filipe Manana
2026-09-14 18:24   ` Hanabishi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox