systemd: serialize generated initrd fsck device probes - #18640
Draft
Pawel Winogrodzki (PawelWMS) wants to merge 1 commit into
Draft
systemd: serialize generated initrd fsck device probes#18640Pawel Winogrodzki (PawelWMS) wants to merge 1 commit into
Pawel Winogrodzki (PawelWMS) wants to merge 1 commit into
Conversation
Pawel Winogrodzki (PawelWMS)
force-pushed
the
pawelwi/systemd-fsck-device-lock
branch
from
August 27, 2026 23:09
eb85653 to
e73eb17
Compare
Prevent udev from probing filesystem metadata while initrd fsck updates it. Temporarily wrap generated root and /usr checks with udevadm lock. Update all affected fstab-generator fixtures, including the existing command-line /usr case. Remove this workaround when native e2fsprogs whole-disk locking is integrated. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bb0e6716-4886-4e95-9efe-71dcde8687d6
Pawel Winogrodzki (PawelWMS)
force-pushed
the
pawelwi/systemd-fsck-device-lock
branch
from
August 27, 2026 23:16
e73eb17 to
118c1be
Compare
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.
Temporary workaround
Important
This change is temporary until the upstream
e2fsck: take flock(LOCK_EX) on whole-disk device during filesystem checkpatch is available and integrated into Azure Linux.Remove this workaround as part of that integration. The outer
udevadm lockand the proposed native e2fsck lock must not run together: each opens the whole disk independently, so e2fsck can block waiting for the lock held by its waiting parent and deadlock boot.What
systemd-fstab-generatorso generated initrd root and/usrfilesystem checks run throughudevadm lock.systemd-fsck./usrfilesystem checks.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.Scope
This option targets only generator-synthesized initrd
systemd-fsck-root.serviceandsystemd-fsck-usr.serviceunits. Static root and instantiated post-switch-root checks remain unchanged. Draft #18639 explores the alternative root drop-in implementation.Risk
fsckfrom starting and fails the generated unit./usrpartitions on one physical disk serialize instead of checking concurrently.Verification
test-fstab-generatorfixtures, including generated/usrcoverage and the existing command-line/usrcase.git diff --check.