Skip to content

systemd: serialize generated initrd fsck device probes - #18640

Draft
Pawel Winogrodzki (PawelWMS) wants to merge 1 commit into
microsoft:3.0-devfrom
PawelWMS:pawelwi/systemd-fsck-device-lock
Draft

systemd: serialize generated initrd fsck device probes#18640
Pawel Winogrodzki (PawelWMS) wants to merge 1 commit into
microsoft:3.0-devfrom
PawelWMS:pawelwi/systemd-fsck-device-lock

Conversation

@PawelWMS

Copy link
Copy Markdown
Contributor

What

  • Patch systemd-fstab-generator so generated initrd root and /usr filesystem checks run through udevadm lock.
  • Use the exact generated device path for lock acquisition and systemd-fsck.
  • Update existing generator fixtures and add coverage for generated /usr filesystem checks.

Why

systemd-udevd can probe filesystem metadata while fsck is 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.service and systemd-fsck-usr.service units. Static root and instantiated post-switch-root checks remain unchanged. Draft #18639 explores the complementary static drop-in option.

Risk

  • The behavior is unconditional after the package upgrade and initramfs regeneration; rollback requires removing the patch and rebuilding the initramfs.
  • Lock acquisition has a hard 180-second ceiling; timeout prevents fsck from starting and fails the generated unit.
  • Root and /usr partitions on one physical disk serialize instead of checking concurrently.
  • This downstream source patch must be rebased when systemd changes the generator or fixtures.

Verification

  • Verified the patch applies to the pristine systemd v255 source used by this package.
  • Updated all affected test-fstab-generator fixtures and added generated /usr coverage.
  • Ran git diff --check.
  • Passed repository commit and push hooks.
  • Completed adversarial Advocate, Skeptic, and Architect review.
  • Full package build and generator test execution were not available locally; draft CI and review are required.

Wrap generated initrd root and /usr filesystem checks with
udevadm lock so udev probing cannot overlap metadata updates.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: bb0e6716-4886-4e95-9efe-71dcde8687d6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.0-dev PRs Destined for AzureLinux 3.0 Packaging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant