checkpoint: fix masked directories with a non-default root - #2239
Merged
Merged
Conversation
A masked directory is a bind mount of a shared empty directory, which lives under the state root. As it is an external mount for CRIU, it is registered with a key which is the path of that directory, both on checkpoint and restore. On checkpoint, container->context is not set, so the default state root is used instead of the one set by --root. As a result, restore fails with something like: Error (criu/mount.c:3141): mnt: No mapping for 420:(null) mountpoint This was broken since the shared empty directory is registered with CRIU (commit d8a88c0, fixing the regression from 4004e5b, PR containers#1859), i.e. since crun 1.24. The crun tests did not catch this as they do not use masked paths; runc integration tests do. Set container->context on checkpoint, like it is done for other operations, and add a test case. Fixes: d8a88c0 ("criu: checkpoint correctly the shared empty directory path") Signed-off-by: Kir Kolyshkin <[email protected]>
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.
A masked directory is a bind mount of a shared empty directory, which lives under the state root. As it is an external mount for CRIU, it is registered with a key which is the path of that directory, both on checkpoint and restore.
On checkpoint,
container->contextis not set, so the default state root is used instead of the one set by--root. As a result, restore fails with something like:This was broken since the shared empty directory is registered with CRIU (commit d8a88c0, which fixed the regression from 4004e5b, #1859), i.e. since crun 1.24. The crun tests did not catch this as they do not use masked paths; runc integration tests do (found in #2238).
Set
container->contexton checkpoint, like it is done for other operations, and add a test case.Fixes: d8a88c0 ("criu: checkpoint correctly the shared empty directory path")