graphdriver/btrfs: depend on kernel UAPI instead of libbtrfs#44761
Merged
neersighted merged 5 commits intomoby:masterfrom Jan 6, 2023
Merged
graphdriver/btrfs: depend on kernel UAPI instead of libbtrfs#44761neersighted merged 5 commits intomoby:masterfrom
neersighted merged 5 commits intomoby:masterfrom
Conversation
94b0ebc to
26afcfe
Compare
AkihiroSuda
approved these changes
Jan 6, 2023
AkihiroSuda
reviewed
Jan 6, 2023
4787ad0 to
2c5ef04
Compare
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]>
2c5ef04 to
19bdff1
Compare
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]>
While the Cgo in this entire file is quite questionable, that is a task for another day. Signed-off-by: Bjorn Neergaard <[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]>
This is no longer necessary after the switch to the kernel UAPI. Signed-off-by: Bjorn Neergaard <[email protected]>
19bdff1 to
aa80c33
Compare
This was referenced Jan 7, 2023
Merged
This was referenced Jan 9, 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.
- What I did
Use the kernel UAPI to provide the Btrfs headers, instead of btrfs-progs/libbtrfs
- How I did it
Given #44707 this was a very straightforward substitution with most of the work in research/verification.
- How to verify it
Verify the assumptions (e.g. kernel versions) and use containers to test building on platforms of interest (e.g. EL 7 with newer kernel headers).
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)
