external: normalize file id lookup and warn on fallback reopen#2992
Open
cheese-cakee wants to merge 1 commit intocheckpoint-restore:criu-devfrom
Open
external: normalize file id lookup and warn on fallback reopen#2992cheese-cakee wants to merge 1 commit intocheckpoint-restore:criu-devfrom
cheese-cakee wants to merge 1 commit intocheckpoint-restore:criu-devfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to make external regular-file id matching more robust across equivalent numeric representations (decimal vs hex) and improve restore diagnostics when CRIU falls back from --inherit-fd to path-based reopen.
Changes:
- Add normalization logic for
file[mnt_id:inode]matching in external id lookup (keeping exact string compare as a fast path). - Emit a warning during restore when an external file has no
--inherit-fdmapping and CRIU falls back to reopening by path. - Update CLI help and documentation to describe accepted numeric formats for
file[mnt_id:inode].
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
criu/files-reg.c |
Adds a warning when --inherit-fd mapping is missing for an external file. |
criu/external.c |
Introduces parsing/normalization for file[mnt_id:inode] during external id lookup. |
criu/crtools.c |
Updates --external / --inherit-fd help text for file[mnt_id:inode] formats. |
Documentation/criu.txt |
Clarifies documentation for --external file[mnt_id:inode] numeric formats. |
a962016 to
11276ef
Compare
Signed-off-by: Farzan Aman Khan <farzanaman99@gmail.com>
11276ef to
7bf7613
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.
Why this PR is necessary
External regular-file restore can behave inconsistently when the same
file[mnt_id:inode]is written in different numeric forms (for example decimal in one place and0xform in another). In that case, mapping lookup may miss a logically identical external file id and restoration falls back unexpectedly.This PR makes matching robust for equivalent numeric ids and improves diagnostics when fallback is used.
What this PR changes
file[mnt_id:inode]during external id lookup so decimal and0xforms are treated as equal by value.--inherit-fdmapping is found for an external file id and restore falls back to reopen-by-path.mnt_idandinodeinfile[mnt_id:inode]may be decimal or0xhex.Scope
Testing
git diff --check HEAD~1..HEADpython3 -m py_compile test/zdtm.py test/zdtm/criu_config.py