mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
mnt: Read mount images early
Mappings from mount id to namespace will be required to remove ghosts on restore failure. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
b0e23c3d4f
commit
a7c9f3011d
3 changed files with 7 additions and 4 deletions
|
|
@ -118,6 +118,7 @@ extern int depopulate_roots_yard(void);
|
|||
extern int rst_get_mnt_root(int mnt_id, char *path, int plen);
|
||||
extern int ext_mount_add(char *key, char *val);
|
||||
extern int mntns_maybe_create_roots(void);
|
||||
extern int read_mnt_ns_img(void);
|
||||
extern void cleanup_mnt_ns(void);
|
||||
|
||||
#endif /* __CR_MOUNT_H__ */
|
||||
|
|
|
|||
5
mount.c
5
mount.c
|
|
@ -2509,7 +2509,7 @@ err:
|
|||
return -1;
|
||||
}
|
||||
|
||||
static int read_mnt_ns_img(void)
|
||||
int read_mnt_ns_img(void)
|
||||
{
|
||||
struct mount_info *pms = NULL;
|
||||
struct ns_id *nsid;
|
||||
|
|
@ -2673,9 +2673,6 @@ static int populate_mnt_ns(void)
|
|||
struct mount_info *pms;
|
||||
struct ns_id *nsid;
|
||||
|
||||
if (read_mnt_ns_img())
|
||||
return -1;
|
||||
|
||||
pms = mnt_build_tree(mntinfo);
|
||||
if (!pms)
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -1324,8 +1324,13 @@ int prepare_namespace_before_tasks(void)
|
|||
if (mntns_maybe_create_roots())
|
||||
goto err_mnt;
|
||||
|
||||
if (read_mnt_ns_img())
|
||||
goto err_img;
|
||||
|
||||
return 0;
|
||||
|
||||
err_img:
|
||||
cleanup_mnt_ns();
|
||||
err_mnt:
|
||||
/*
|
||||
* Nothing, netns' descriptor will be closed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue