Commit f22591c9 authored by Pavel Emelyanov's avatar Pavel Emelyanov

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: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 74357818
...@@ -579,22 +579,17 @@ int dump_one_reg_file(int lfd, u32 id, const struct fd_parms *p) ...@@ -579,22 +579,17 @@ int dump_one_reg_file(int lfd, u32 id, const struct fd_parms *p)
} else } else
link = p->link; link = p->link;
if (p->mnt_id >= 0 && (root_ns_mask & CLONE_NEWNS)) { nsid = lookup_nsid_by_mnt_id(p->mnt_id);
if (lookup_mnt_id(p->mnt_id) == NULL) { if (nsid == NULL) {
pr_err("No mount for the %d file in the namespaces\n", p->mnt_id); pr_err("Unable to look up the %d mount\n", p->mnt_id);
return -1; return -1;
} }
if (p->mnt_id >= 0 && (root_ns_mask & CLONE_NEWNS)) {
rfe.mnt_id = p->mnt_id; rfe.mnt_id = p->mnt_id;
rfe.has_mnt_id = true; 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;
}
pr_info("Dumping path for %d fd via self %d [%s]\n", pr_info("Dumping path for %d fd via self %d [%s]\n",
p->fd, lfd, &link->name[1]); p->fd, lfd, &link->name[1]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment