mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-02 23:35:21 +00:00
files-reg: skip failed mount lookup for shell-job's tty
When we restore a shell-job we would inherit tty-s, so even if we don't have a right mount for it in container on dump, on restore it should just be right. Else when dumping second time via criu-ns we get: (00.005678) Error (criu/files-reg.c:1710): Can't lookup mount=29 for fd=0 path=/dev/pts/20 Fixes: #1893 Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
This commit is contained in:
committed by
Andrei Vagin
parent
9e91e62a7c
commit
2039d73200
@@ -14,6 +14,8 @@
|
|||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
#include <elf.h>
|
#include <elf.h>
|
||||||
|
|
||||||
|
#include "tty.h"
|
||||||
|
|
||||||
#ifndef SEEK_DATA
|
#ifndef SEEK_DATA
|
||||||
#define SEEK_DATA 3
|
#define SEEK_DATA 3
|
||||||
#define SEEK_HOLE 4
|
#define SEEK_HOLE 4
|
||||||
@@ -1689,6 +1691,7 @@ int dump_one_reg_file(int lfd, u32 id, const struct fd_parms *p)
|
|||||||
int ret;
|
int ret;
|
||||||
FileEntry fe = FILE_ENTRY__INIT;
|
FileEntry fe = FILE_ENTRY__INIT;
|
||||||
RegFileEntry rfe = REG_FILE_ENTRY__INIT;
|
RegFileEntry rfe = REG_FILE_ENTRY__INIT;
|
||||||
|
bool skip_for_shell_job = false;
|
||||||
|
|
||||||
if (!p->link) {
|
if (!p->link) {
|
||||||
if (fill_fdlink(lfd, p, &_link))
|
if (fill_fdlink(lfd, p, &_link))
|
||||||
@@ -1708,11 +1711,15 @@ int dump_one_reg_file(int lfd, u32 id, const struct fd_parms *p)
|
|||||||
|
|
||||||
mi = lookup_mnt_id(p->mnt_id);
|
mi = lookup_mnt_id(p->mnt_id);
|
||||||
if (mi == NULL) {
|
if (mi == NULL) {
|
||||||
pr_err("Can't lookup mount=%d for fd=%d path=%s\n", p->mnt_id, p->fd, link->name + 1);
|
if (opts.shell_job && is_tty(p->stat.st_rdev, p->stat.st_dev)) {
|
||||||
return -1;
|
skip_for_shell_job = true;
|
||||||
|
} else {
|
||||||
|
pr_err("Can't lookup mount=%d for fd=%d path=%s\n", p->mnt_id, p->fd, link->name + 1);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mnt_is_overmounted(mi)) {
|
if (!skip_for_shell_job && mnt_is_overmounted(mi)) {
|
||||||
pr_err("Open files on overmounted mounts are not supported yet\n");
|
pr_err("Open files on overmounted mounts are not supported yet\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -1732,7 +1739,7 @@ int dump_one_reg_file(int lfd, u32 id, const struct fd_parms *p)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (check_path_remap(link, p, lfd, id, mi->nsid))
|
if (!skip_for_shell_job && check_path_remap(link, p, lfd, id, mi->nsid))
|
||||||
return -1;
|
return -1;
|
||||||
rfe.name = &link->name[1];
|
rfe.name = &link->name[1];
|
||||||
ext:
|
ext:
|
||||||
|
Reference in New Issue
Block a user