Regression in v5.14-rc1: f2165627319f btrfs: compression: don't try to compress if we don't have enough pages

Zygo Blaxell
2021-08-22T05:52:18Z

Before this commit:

# head /dev/zero -c 4095 > inline
# compsize inline
Type Perc Disk Usage Uncompressed Referenced
TOTAL 0% 18B 3.9K 3.9K
zstd 0% 18B 3.9K 3.9K

After this commit:

# head /dev/zero -c 4095 > inline
# compsize inline
Processed 1 file, 1 regular extents (1 refs), 0 inline.
Type Perc Disk Usage Uncompressed Referenced
TOTAL 100% 4.0K 4.0K 4.0K
none 100% 4.0K 4.0K 4.0K

This change makes the metadata sizes of trees of small files (e.g. source
checkouts) blow up.

It looks like we need to look at the offset of the extent, as well as
its length.