On 12/19/2018 7:57 PM, Qu Wenruo wrote:
On 2018/12/19 下午11:41, devzero@xxxxxx wrote:
does compress-force really force compression?
It should.
The only exception is block size.
If the file is smaller than the sector size (4K for x86_64), then no
compression no matter whatever the mount options are.
for me (found via compsize - see https://github.com/kilobyte/compsize/issues/24 ) it looks it is problably forcing compression check for every block of a file (while compress= makes btrfs skip compression check after first block) and if some block is incompressible, apparently it's being stored uncompressed.
Any reproducer for this unexpected behavior?
Not a reproducer, but this appears to be how it's been behaving on my
systems since I started using BTRFS.
It's also arguably far more useful to behave this way than to just
unconditionally compress everything, it wastes essentially zero time
compared to that, and gets you better space utilization (which is big,
since the size of the blocks we're compressing can mean that
incompressible data expands significantly when we compress it).