doc: warn that preallocation disables compression on btrfs #1692
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(foreword: I open PRs as issues when it's not much work to write, feel free to close this and adjust documentation otherwise if that is better for you)
Rationale:
Current aria2c documentation for
--file-allocation
states:For btrfs, it might be worth noting that preallocating a file with falloc() will disable cow for writes in the preallocated area, and has the side-effect of also disabling file compression for that file.
(I'm not exactly sure what would happen with zero-filling manually, but even
prealloc
uses fallocate now if supported apparently so this is moot -- either cow is still supported and the writes are thrown away, with the compression autodetection mechanism thrown down the floor (e.g. likely compressing even if data isn't compressible) or cow is disabled and compression gone)This has been a subtle issue for nixos for a while:
NixOS/nix#3550
While they are not using aria2c, that illustrates quite well that knowledge of how btrfs compression works is quite sparse so a note documenting the tradeoff (potential speed vs. compression) in the documentation would probably make sense; hence this commit.
test:
Original commit message:
falloc() will disable cow for writes in the preallocated area, and
has the side-effect of also disabling file compression for that file.
If user wants compression they should be advised to use trunc or none
file-allocation instead.