Mount btrfs volumes with space cache v2 on Fedora 41 and later - #67
Open
nabeya11 wants to merge 1 commit into
Open
Mount btrfs volumes with space cache v2 on Fedora 41 and later#67nabeya11 wants to merge 1 commit into
nabeya11 wants to merge 1 commit into
Conversation
Filesystems created before btrfs-progs 5.15 enabled free-space-tree by default still use space cache v1, and kernel 6.11 warns that it is deprecated on every mount. Since btrfs partitions are not recreated when the root partition is switched, such filesystems survive OS updates and need the mount option to be converted. Fedora 41 is the first release shipping kernel 6.11, so older releases keep the previous options. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new Fedora-version conditional uses an unquoted numeric test on FEDORA_MAJOR, which can fail noisily or break execution under set -u if the variable is unset or non-numeric.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the Fedora kickstart generation flow to add space_cache=v2 to btrfs mount options on Fedora 41+ (kernel 6.11+), avoiding deprecation warnings for space cache v1 and enabling conversion to free-space-tree on mount.
Changes:
- Introduces a new
@@BTRFS_EXTRA_FSOPTIONS@@placeholder appended to btrfs--fsoptionsinks.tpl.cfg. - Populates that placeholder in
entrypoint.shwith,space_cache=v2only whenFEDORA_MAJOR >= 41.
File summaries
| File | Description |
|---|---|
| ks.tpl.cfg | Appends a placeholder to btrfs --fsoptions so extra mount options can be conditionally injected. |
| entrypoint.sh | Computes btrfs_extra_fsoptions for Fedora 41+ and adds a sed replacement for the new placeholder. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
nabeya11
marked this pull request as ready for review
September 10, 2026 12:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Background
Filesystems created before btrfs-progs 5.15 enabled free-space-tree by default still use space cache v1, which kernel 6.11 and later report as deprecated on every mount. btrfs partitions are not recreated when the root partition is switched, so they survive OS updates.
Purpose
Convert them to space cache v2 (free space tree). Fresh installations already get v2 from mkfs.btrfs.
Implementation
Add
space_cache=v2to the btrfs--fsoptionsthrough the new@@BTRFS_EXTRA_FSOPTIONS@@placeholder. entrypoint.sh fills it in only for Fedora 41 and later, the first release shipping kernel 6.11.