Repository navigation
fix: avoid the by-label link race after formatting - #473
Merged
Merged
Conversation
otavio
force-pushed
the
fix/wait-udev-after-mkfs
branch
from
November 19, 2026 20:36
1d5650a to
ad1e7ee
Compare
- Canonicalize device targets such as /dev/disk/by-label/* to the node they point at - Formatting rewrites the label, so udev recreates the link and a mount right after mkfs can find it missing; the node itself is stable - Keep unresolvable paths as given so validation still reports them as missing - Add a test for link resolution
otavio
force-pushed
the
fix/wait-udev-after-mkfs
branch
from
November 21, 2026 13:33
c24841a to
f7c9a82
Compare
- A missing link now fails as DeviceDoesNotExist naming the configured path, instead of falling back to the link and failing later at mount with ENOENT - Other resolution errors, such as a symlink loop or EACCES, are propagated instead of being reported as a missing device - Trace which node a target resolves to, since errors now name the node rather than the link
- Raw and raw-delta validated the resolved node but ran their space check, install-if-different read and write through the configured link - Use the resolved target throughout, like the other installers, so a link udev is recreating cannot be reached mid-install
- mkfs rewrites the label, so udev recreates /dev/disk/by-label/* while a later object in the same update may already be resolving that link - Run `udevadm settle --timeout=30` after formatting when it is available: the queue is global, so unrelated events must not hold the update for the 120 s default - Skip it for JFFS2 and UBIFS, whose MTD devices have no /dev/disk links; boards without udev keep working and a settle failure is only logged - Tests replace the tools with scripts on PATH to confirm the call, the MTD skip and that a failing settle does not fail the format
otavio
force-pushed
the
fix/wait-udev-after-mkfs
branch
from
November 21, 2026 13:50
f7c9a82 to
0d9980e
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.
Summary
Formatting a target reached through
/dev/disk/by-label/*could fail right aftermkfs: the new label makes udev drop and recreate the link, and the mount through it found "No such file or directory". It failed 2 of 3 times on one board; the update stopped before switching sets.fix(target): resolve device links to their device node:get_targetresolves a device path to its node once, so format and both mounts use the node instead of the link.fix(target): report device targets that cannot be resolved: a missing link fails asDeviceDoesNotExistnaming the configured path; other errors (symlink loop, EACCES) are propagated instead of being reported as missing. The resolved node is traced.fix(raw): check and write the resolved target: raw and raw-delta validated the node but read and wrote through the link; they now use the node throughout.fix(fs): wait for udev after formatting a device: a later object may still reach the device through the link, soudevadm settle --timeout=30runs after formatting when available. Skipped for JFFS2/UBIFS; a failure is only logged.Argument quoting for the commands these paths reach is in the stacked PR on top of this one.
Testing
cargo clippy -p updatehub --all-targets -- -D warningsandcargo test -p updatehub --libpass on every commit (142 passed, 29 ignored at the tip).