Commit 42625eac authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Pavel Emelyanov

change find_ext_ns_id() to do collect_mntinfo(ext_ns) on demand

Currently we rely on the fact that ->mntinfo_list was already
collected by walk_namespaces(walk_all => true), but we are going
to change this.

This patch simply adds collect_mntinfo(ns) into find_ext_ns_id() if
->mntinfo_list == NULL. This is all we need for this ns_id if it was
not initialized by collect_mnt_namespaces().
Signed-off-by: 's avatarOleg Nesterov <oleg@redhat.com>
Tested-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent b1ab3317
...@@ -699,6 +699,9 @@ static struct ns_id *find_ext_ns_id(void) ...@@ -699,6 +699,9 @@ static struct ns_id *find_ext_ns_id(void)
for (ns = ns_ids; ns->next; ns = ns->next) for (ns = ns_ids; ns->next; ns = ns->next)
if (ns->pid == pid && ns->nd == &mnt_ns_desc) { if (ns->pid == pid && ns->nd == &mnt_ns_desc) {
if (!ns->mnt.mntinfo_list &&
!collect_mntinfo(ns, true))
break;
return ns; return ns;
} }
......
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