[23.0 backport] graphdriver/btrfs: depend on kernel UAPI instead of libbtrfs#44776
Merged
Conversation
Signed-off-by: Sebastiaan van Stijn <[email protected]> (cherry picked from commit 7fbf321) Signed-off-by: Sebastiaan van Stijn <[email protected]>
This is actually quite meaningless as we are reporting the libbtrfs version, but we do not use libbtrfs. We only use the kernel interface to btrfs instead. While we could report the version of the kernel headers in play, they're rather all-or-nothing: they provide the structures and defines we need, or they don't. As such, drop all version information as the host kernel version is the only thing that matters. Signed-off-by: Bjorn Neergaard <[email protected]> (cherry picked from commit 1449c82) Signed-off-by: Sebastiaan van Stijn <[email protected]>
By relying on the kernel UAPI (userspace API), we can drop a dependency and simplify building Moby, while also ensuring that we are using a stable/supported source of the C types and defines we need. btrfs-progs mirrors the kernel headers, but the headers it ships with are not the canonical source and as [we have seen before][44698], could be subject to changes. Depending on the canonical headers from the kernel both is more idiomatic, and ensures we are protected by the kernel's promise to not break userspace. [44698]: moby#44698 Signed-off-by: Bjorn Neergaard <[email protected]> (cherry picked from commit 3208dca) Signed-off-by: Sebastiaan van Stijn <[email protected]>
While the Cgo in this entire file is quite questionable, that is a task for another day. Signed-off-by: Bjorn Neergaard <[email protected]> (cherry picked from commit d3778d6) Signed-off-by: Sebastiaan van Stijn <[email protected]>
We only need suitable UAPI headers now. They are available on kernel 4.7 and newer; out of the distributions currently in support that users might be interested in, only Enterprise Linux 7 has too old a kernel (3.10). Users of Enterprise Linux 7 distros can compile using a newer platform, disable the Btrfs graphdriver as documented in this file, or use newer kernel headers on their older distro. Signed-off-by: Bjorn Neergaard <[email protected]> (cherry picked from commit c9d632e) Signed-off-by: Sebastiaan van Stijn <[email protected]>
This is no longer necessary after the switch to the kernel UAPI. Signed-off-by: Bjorn Neergaard <[email protected]> (cherry picked from commit aa80c33) Signed-off-by: Sebastiaan van Stijn <[email protected]>
`linux/btrfs_tree.h` was not installed to `/usr/include` until kernel 4.12 torvalds/linux@fcc8487 Signed-off-by: Akihiro Suda <[email protected]> (cherry picked from commit 89fb8b3) Signed-off-by: Sebastiaan van Stijn <[email protected]>
neersighted
approved these changes
Jan 10, 2023
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.
backport of
7fbf321 (part of replace redundant fmt.Sprintf() with strconv #44256) to get a clean cherry-pick
graphdriver/btrfs: depend on kernel UAPI instead of libbtrfs #44761
graphdriver/btrfs: needs kernel headers >= 4.12, not >= 4.7 #44762
Relates to daemon/graphdriver/btrfs: workaround field rename in btrfs-progs 6.1 #44707
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)