Skip to content

Commit

Permalink
mount: close mnt.ns_fd only for sub-namespaces (v3)
Browse files Browse the repository at this point in the history
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: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
  • Loading branch information
avagin authored and xemul committed Nov 27, 2015
1 parent 9737310 commit af956f4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit af956f4

Please sign in to comment.