Commit 8550f520 authored by Pavel Emelyanov's avatar Pavel Emelyanov

mnt: Move local mntns collecting on restore into prepare_mnt_ns

Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 05c02ddc
...@@ -1240,10 +1240,6 @@ static int restore_task_with_children(void *_arg) ...@@ -1240,10 +1240,6 @@ static int restore_task_with_children(void *_arg)
if (prepare_namespace(current, ca->clone_flags)) if (prepare_namespace(current, ca->clone_flags))
exit(1); exit(1);
if (!(root_ns_mask & CLONE_NEWNS))
if (rst_collect_local_mntns())
exit(1);
/* /*
* We need non /proc proc mount for restoring pid and mount * We need non /proc proc mount for restoring pid and mount
* namespaces and do not care for the rest of the cases. * namespaces and do not care for the rest of the cases.
......
...@@ -32,7 +32,6 @@ extern bool phys_stat_dev_match(struct mount_info *tree, dev_t st_dev, ...@@ -32,7 +32,6 @@ extern bool phys_stat_dev_match(struct mount_info *tree, dev_t st_dev,
extern int restore_task_mnt_ns(struct ns_id *nsid, pid_t pid); extern int restore_task_mnt_ns(struct ns_id *nsid, pid_t pid);
extern int fini_mnt_ns(void); extern int fini_mnt_ns(void);
int rst_collect_local_mntns(void);
char *rst_get_mnt_root(int mnt_id); char *rst_get_mnt_root(int mnt_id);
#endif /* __CR_MOUNT_H__ */ #endif /* __CR_MOUNT_H__ */
...@@ -1422,7 +1422,7 @@ static int create_mnt_roots(void) ...@@ -1422,7 +1422,7 @@ static int create_mnt_roots(void)
return 0; return 0;
} }
int rst_collect_local_mntns(void) static int rst_collect_local_mntns(void)
{ {
struct ns_id *nsid; struct ns_id *nsid;
...@@ -1711,7 +1711,7 @@ int prepare_mnt_ns(void) ...@@ -1711,7 +1711,7 @@ int prepare_mnt_ns(void)
struct ns_id ns = { .pid = getpid(), .nd = &mnt_ns_desc }; struct ns_id ns = { .pid = getpid(), .nd = &mnt_ns_desc };
if (!(root_ns_mask & CLONE_NEWNS)) if (!(root_ns_mask & CLONE_NEWNS))
return 0; return rst_collect_local_mntns();
pr_info("Restoring mount namespace\n"); pr_info("Restoring mount namespace\n");
......
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