2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 05:48:05 +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:
Pavel Emelyanov 2014-04-23 03:01:21 +04:00
parent 74357818f8
commit f22591c99a

View File

@ -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]);