Skip to content

Commit 1322279

Browse files
committed
btrfs compress doc: mention that fallocate disables compression
1 parent 9a1ef4a commit 1322279

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Documentation/ch-compression.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,23 @@ more CPU the system performance is affected.
9898
Level 0 always maps to the default. The compression level does not affect
9999
compatibility.
100100

101+
Exceptions
102+
----------
103+
104+
Any file that has been touched by the *fallocate* system call will always be
105+
excepted from compression even if *force-compress* mount option is used.
106+
107+
The reason for this is that a successful *fallocate* call must guarantee that
108+
future writes to the allocated range will not fail because of lack of space.
109+
This is difficult to guarantee in a COW filesystem. To reduce the chances of
110+
it happening, btrfs preallocates space and disables compression for the file.
111+
112+
As a workaround, one can trigger a compressed rewrite for such a file using the
113+
*btrfs defrag* command. Be aware that if the file is touched again by the
114+
*fallocate* system call, it will be excepted again from compression for all the
115+
new data written to it.
116+
117+
101118
Incompressible data
102119
-------------------
103120

0 commit comments

Comments
 (0)