Commit 947dcc73 authored by Andrey Ryabinin's avatar Andrey Ryabinin Committed by Pavel Emelyanov

mount: use correct mount namespace in open_mountpoint

open_mountpoint() have to operate in target's mount namespace,
which may differ from root's namespace - root_item->pid.real.

So obtain the correct mount namespace from mount_info and use
it in switch_ns().
Signed-off-by: 's avatarAndrey Ryabinin <aryabinin@virtuozzo.com>
Acked-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent bada2929
......@@ -1085,7 +1085,7 @@ static int open_mountpoint(struct mount_info *pm)
return -1;
}
if (switch_ns(root_item->pid.real, &mnt_ns_desc, &ns_old) < 0)
if (switch_ns(pm->nsid->ns_pid, &mnt_ns_desc, &ns_old) < 0)
goto out;
mnt_path = mkdtemp(mnt_path_tmp);
......
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