Skip to content

Commit 39a2654

Browse files
jimiskdave
authored andcommitted
btrfs-progs: docs: mention that fallocate disables compression
An inode with successful fallocated range will never be compressed in the future, this is a limitation in btrfs' NOCOW fallback behavior. Add a clarification to avoid confusion to end users. Signed-off-by: Dimitrios Apostolou <[email protected]> [ Add a proper commit message and SoB line. ] Signed-off-by: Qu Wenruo <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 60efeb9 commit 39a2654

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)