Skip to content

fix: strict filesystem unmount before kexec - #188

Closed
GeertJohan wants to merge 1 commit into
metal-stack:masterfrom
GeertJohan:fix/strict-unmount
Closed

fix: strict filesystem unmount before kexec#188
GeertJohan wants to merge 1 commit into
metal-stack:masterfrom
GeertJohan:fix/strict-unmount

Conversation

@GeertJohan

Copy link
Copy Markdown

Unmount failures during the post-installation teardown were tolerated (logged and ignored) and the unmounts used MNT_FORCE. Both are wrong:

  • per umount(2), MNT_FORCE only asks network filesystems (nfs, cifs, fuse, 9p, ceph, lustre) to abort in-flight requests, 'could cause data loss', and is a no-op on local filesystems - it cannot overcome EBUSY.
  • the machine kexecs right after the teardown, and kexec does not flush the page cache ('reboot doesn't sync: do that yourself before calling this', kernel/reboot.c). A tolerated unmount failure therefore silently loses the latest writes. Observed in the field (v0.14.1 era, Supermicro H13SRD-F): installed machines booting with the OS image's placeholder /etc/fstab - the real fstab is written moments before the teardown - leaving a read-only root and the filesystemlayout's extra mounts (e.g. /var/lib) unmounted, which broke FRR on firewalls.

A successful unmount flushes all dirty pages and marks the filesystem clean by itself, so exactly two outcomes are sound: unmounted (and therefore durable), or a failed installation that is reported and retried. Prior art: Ignition's umount stage also treats unmount failure as fatal; Talos and coreos-installer unmount without MNT_FORCE.

fixes #186

Used AI-Tools ✨

Claude Code Fable 5 was used to identify the issue and test fixes. Code has been reviewed line-by-line by myself.

Unmount failures during the post-installation teardown were tolerated
(logged and ignored) and the unmounts used MNT_FORCE. Both are wrong:

- per umount(2), MNT_FORCE only asks network filesystems (nfs, cifs,
  fuse, 9p, ceph, lustre) to abort in-flight requests, 'could cause
  data loss', and is a no-op on local filesystems - it cannot overcome
  EBUSY.
- the machine kexecs right after the teardown, and kexec does not flush
  the page cache ('reboot doesn't sync: do that yourself before calling
  this', kernel/reboot.c). A tolerated unmount failure therefore
  silently loses the latest writes. Observed in the field (v0.14.1 era,
  Supermicro H13SRD-F): installed machines booting with the OS image's
  placeholder /etc/fstab - the real fstab is written moments before the
  teardown - leaving a read-only root and the filesystemlayout's extra
  mounts (e.g. /var/lib) unmounted, which broke FRR on firewalls.

A successful unmount flushes all dirty pages and marks the filesystem
clean by itself, so exactly two outcomes are sound: unmounted (and
therefore durable), or a failed installation that is reported and
retried. Prior art: Ignition's umount stage also treats unmount failure
as fatal; Talos and coreos-installer unmount without MNT_FORCE.

Generated-By: Claude Code Fable 5
@GeertJohan
GeertJohan requested a review from a team as a code owner July 5, 2026 12:30
@metal-robot metal-robot Bot added this to Development Jul 5, 2026
@iljarotar iljarotar moved this to In Progress in Development Jul 13, 2026
@iljarotar

Copy link
Copy Markdown

superseeded #190

@iljarotar iljarotar closed this Jul 13, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Development Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

kexec can happen before all changes are written to disk

2 participants