Repository navigation
Conversation
CRIU knows the external mounts by their mount point, but the destinations of the bind mounts were resolved under the rootfs on the host. When a destination goes through a link of another mount of the container, or through a link in the rootfs with a root path relative to the bundle, that is not the mount point and the checkpoint fails with: mnt: ./real/data doesn't have a proper root mount Resolve the destinations as the kernel did when they were mounted: on checkpoint in the root of the running container, on restore in the rootfs where the mount points are already created in the same order as on create, with the bind mounts done before. Both use the same function, so the restore gives CRIU the mount points recorded by the checkpoint. Add checkpoint/restore tests with a link in the destination of a bind mount, in the rootfs and in another mount. Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
giuseppe
force-pushed
the
ckpt-resolve-binds
branch
from
November 11, 2026 10:07
b916495 to
5497399
Compare
giuseppe
marked this pull request as ready for review
November 11, 2026 10:07
Member
Author
|
The reproducer using just podman: #!/bin/sh
S=/var/tmp/repro
mkdir -p $S/a/real/data $S/b; ln -s real $S/a/link
podman run -d --name t -v $S/a:/mnt -v $S/b:/mnt/link/data docker.io/library/alpine sleep 1000
podman container checkpoint t -e $S/t.tar
podman rm -f t
podman container restore -i $S/t.tar |
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.
CRIU matches the external mounts by the mount point recorded in the mount table, but the destinations were resolved against the rootfs on the host. That differs from what the kernel did when the destination goes through a link of another mount of the container, or when the root path is relative to the bundle: the checkpoint fails with "doesn't have a proper root mount".
Resolve the destinations in the root of the running container and save them in the checkpoint, since the restore cannot resolve them without the container and fails with "No mapping for mountpoint".