mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
mount: Fix trailing / when a file is bind-mounted
E.g. I have a /etc/hosts in workspace mounted from the host, and get the following message. (00.141008) 1: mnt-v2: Create plain mountpoint /tmp/.criu.mntns.K1biY1/mnt-0000000938 for 938 (00.141546) 1: mnt-v2: Mounting unsupported @938 (0) (00.141887) 1: mnt-v2: Bind /tmp/agent/1-d8c746c6fda3a8b2/workspace/etc/hosts/ to /tmp/.criu.mntns.K1biY1/mnt-0000000938 (00.142179) 1: Error (criu/mount-v2.c:319): mnt-v2: Failed to open_tree /tmp/agent/1-d8c746c6fda3a8b2/workspace/etc/hosts/: Not a directory (00.143774) Error (criu/cr-restore.c:2320): Restoring FAILED. Signed-off-by: Chuan Qiu <qiuc12@gmail.com>
This commit is contained in:
parent
3dc865bc80
commit
e31828ed8c
1 changed files with 5 additions and 1 deletions
|
|
@ -888,7 +888,11 @@ static int resolve_external_mounts(struct mount_info *info)
|
|||
|
||||
cut_root = cut_root_for_bind(m->root, match->root);
|
||||
|
||||
p = xsprintf("%s/%s", match->ns_mountpoint + 1, cut_root);
|
||||
if (cut_root[0] == '\0') {
|
||||
p = xstrdup(match->ns_mountpoint + 1);
|
||||
} else {
|
||||
p = xsprintf("%s/%s", match->ns_mountpoint + 1, cut_root);
|
||||
}
|
||||
if (!p)
|
||||
return -1;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue