Repository navigation
Keep nested subvolume paths intact during snapshot restore - #20876
Cynnamoroll wants to merge 1 commit into
Conversation
Read each path from the restore journal without splitting on spaces. Use the same reader when rolling back an interrupted restore so a moved child goes back to the original root. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryKeeps nested subvolume paths intact during snapshot restore and rollback.
Reviews (2) · Last reviewed commit: "Keep nested subvolume paths intact durin..." · Reviewed by Greptile |
|
@dhh @omarchybot keeping nested subvolume paths on snapshot restore, including names with spaces, is in #21027, with the restore commit tests. It shares Please consider closing this as superseded only after #21027 is accepted. Leaving the close to you. |
|
GPT-6.2 Sol High in Codex reviewed Opus 5.5 High and muse-wonder via pi (thinking high) agreed the fix was proportionate and found no actionable defects. Their agreement may draw on the same evidence, and review independence is unconfirmed. #21027 includes the identical hook change and regression test. This PR awaits maintainer review of the boot change and approval for the Tests workflow. |
What changes
The systemd-boot restore journal separates nested subvolume paths with colons, but the initramfs hook splits the list on spaces when applying or undoing a restore. A child such as
vm imagesis treated as two children: apply aborts, and interrupted-restore rollback can leave the moved child in the staged root instead of returning it to the original. Read one path at a time in both directions without changing the journal format.Follow-up to #19667.
Verification
ash1.36.1 using scratch directories, the real journal reader, and stand-ins for Btrfs UUIDs and subvolume identity. With the unchanged hook, apply stopped atvm is missing from the old root. With only apply fixed, the fixture reached rollback and showed that the child did not return to the original root. With both sides fixed, apply and rollback each succeeded twice, and both children, includingvm images/guest.img, ended back in the original root.bash test/shell.d/boot-restore-commit-test.sh(7 passing),bash test/shell.d/boot-sync-test.sh(9 passing), andbash test/shell.d/boot-initcpio-sync-test.sh(11 passing).ash -nfor the hook,bash -nfor the test, andgit diff --checkpassed. These are focused fixture tests, not an end-to-end boot. No booted initramfs, real Btrfs restore, EFI writes, host mounts, or physical-device tests. The existing journal format's colon separator is unchanged.Screenshots
No visible change: this corrects path parsing in the initramfs restore and rollback routines; it does not change the restore screen.