Commit af956f45 authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

mount: close mnt.ns_fd only for sub-namespaces (v3)

nsid->mnt.ns_fd is initialized into 0, so currently
fini_restore_mntns() closes the 0 descriptor if processes
lives in a current mount namespace (NS_CRIU).

Without this patch I get the following error:
(00.166444)   4109: Inherit fd tty:[8800:d] -> 0 has been closed

v2: typo fix
v3: do nothing when processes are restored in the local mntns
Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 97373103
......@@ -2650,6 +2650,9 @@ void fini_restore_mntns(void)
{
struct ns_id *nsid;
if (!(root_ns_mask & CLONE_NEWNS))
return;
for (nsid = ns_ids; nsid != NULL; nsid = nsid->next) {
if (nsid->nd != &mnt_ns_desc)
continue;
......
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