mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 13:58:34 +00:00
files: Check for for mount to exist only once
The nsid lookup will search for mount in case mnt_id is given. No need to do it twice (the 2nd time for sanity check). Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
15
files-reg.c
15
files-reg.c
@@ -579,22 +579,17 @@ int dump_one_reg_file(int lfd, u32 id, const struct fd_parms *p)
|
||||
} else
|
||||
link = p->link;
|
||||
|
||||
if (p->mnt_id >= 0 && (root_ns_mask & CLONE_NEWNS)) {
|
||||
if (lookup_mnt_id(p->mnt_id) == NULL) {
|
||||
pr_err("No mount for the %d file in the namespaces\n", p->mnt_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
rfe.mnt_id = p->mnt_id;
|
||||
rfe.has_mnt_id = true;
|
||||
}
|
||||
|
||||
nsid = lookup_nsid_by_mnt_id(p->mnt_id);
|
||||
if (nsid == NULL) {
|
||||
pr_err("Unable to look up the %d mount\n", p->mnt_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (p->mnt_id >= 0 && (root_ns_mask & CLONE_NEWNS)) {
|
||||
rfe.mnt_id = p->mnt_id;
|
||||
rfe.has_mnt_id = true;
|
||||
}
|
||||
|
||||
pr_info("Dumping path for %d fd via self %d [%s]\n",
|
||||
p->fd, lfd, &link->name[1]);
|
||||
|
||||
|
Reference in New Issue
Block a user