systemd: serialize fsck device probes with initrd drop-ins - #18639
Draft
Pawel Winogrodzki (PawelWMS) wants to merge 2 commits into
Draft
systemd: serialize fsck device probes with initrd drop-ins#18639Pawel Winogrodzki (PawelWMS) wants to merge 2 commits into
Pawel Winogrodzki (PawelWMS) wants to merge 2 commits into
Conversation
Wrap static root and instantiated filesystem checks with udevadm lock so udev probing cannot overlap filesystem metadata updates. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bb0e6716-4886-4e95-9efe-71dcde8687d6
Resolve generated root and /usr devices from their BindsTo dependencies, then rebuild initramfs with the lock wrapper and drop-ins. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bb0e6716-4886-4e95-9efe-71dcde8687d6
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
/usrchecks, the static root service, and instantiated device checks.BindsTo=dependency before acquiring the whole-disk lock.Why
systemd-udevdcan probe filesystem metadata whilefsckis still updating it. Serializing the writer against udev's shared whole-disk lock prevents udev from observing transient metadata and removing filesystem identity links before the mount begins.Mechanism
systemd-fstab-generatoralready writes generated root and/usrfsck units withBindsTo=dev-....device. The wrapper reads that loaded-unit property withsystemctl show, converts the escaped device-unit name back to its/dev/...path withsystemd-escape, then runsudevadm lock --device=<path> -- systemd-fsck <path>.For the static non-initrd root service, which has no generated device dependency, the wrapper falls back to
udevadm lock --backing=/and the existing argument-freesystemd-fsckbehavior.The existing Azure Linux
initramfspackage watchessystemdupgrades and regenerates all initramfs images with dracut. The new dracut configuration ensures the drop-ins and resolver are present in those images.Scope
This alternative covers generated initrd root and
/usrchecks, static non-initrd root checks, and instantiated device checks. Draft #18640 explores the simpler generator-layer implementation for the initrd-specific path.Risk
systemctl show,systemd-escape, and dracut file inclusion./usrunits retaining one block-deviceBindsTo=dependency.fsckfrom starting and fails the unit.Verification
BindsTo=device-unit names round-trip throughsystemd-escape --unescape --path.install_itemsentry.git diff --check.