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? Thanks, Qu > > so, the documentation is probably telling misleading information and should be fixed!? > > roland > > > > https://btrfs.wiki.kernel.org/index.php/Compression#What_happens_to_incompressible_files.3F > > What happens to incompressible files? > > There is a simple decision logic: if the first portion of data being compressed is not smaller than the original, the compression of the file is disabled -- unless the filesystem is mounted with -o compress-force. In that case it'll be compressed always regardless of the compressibility of the file. This is not optimal and subject to optimizations and further development. > > >
Attachment:
signature.asc
Description: OpenPGP digital signature
