Commit ce5aa74d authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

mount: save local mount point paths on restore

On restore we add a temporary root to a mount point path. It's convinient
for restoring mount namespaces, but real paths are used for restoring
link-remap files.

v2: replace the offset field on a char * field
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 7db1e6b9
......@@ -114,8 +114,10 @@ struct mount_info {
* On restore mountpoint is prepended with so called ns
* root path -- it's a place in fs where the namespace
* mount tree is constructed. Check mnt_roots for details.
* The ns_mountpoint contains path w/o this prefix.
*/
char *mountpoint;
char *ns_mountpoint;
unsigned flags;
int master_id;
int shared_id;
......
......@@ -1669,6 +1669,7 @@ static int collect_mnt_from_image(struct mount_info **pms, struct ns_id *nsid)
pm->mountpoint = xmalloc(len);
if (!pm->mountpoint)
goto err;
pm->ns_mountpoint = pm->mountpoint + root_len;
/*
* For bind-mounts we would also fix the root here
* too, but bind-mounts restore merges mountpoint
......
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