diff --git a/include/proc_parse.h b/include/proc_parse.h index 3c128b16d..99cf75c10 100644 --- a/include/proc_parse.h +++ b/include/proc_parse.h @@ -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; diff --git a/mount.c b/mount.c index e8e5516f5..b3ddc6bef 100644 --- a/mount.c +++ b/mount.c @@ -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